summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-10-29 17:41:40 -0700
committerJosh Blum <josh@joshknows.com>2012-10-29 17:41:40 -0700
commit49193c85883cc773331033a149e82dd84360a0a6 (patch)
tree1d752a8552e50cc79f6d4522606dd50ed0efd828 /host
parentaef1ab5376bb6b5fc0fc9d9b4e4e474668181086 (diff)
parente3452bf969552abf2497dbd7ac8ed093a3f36de3 (diff)
downloaduhd-49193c85883cc773331033a149e82dd84360a0a6.tar.gz
uhd-49193c85883cc773331033a149e82dd84360a0a6.tar.bz2
uhd-49193c85883cc773331033a149e82dd84360a0a6.zip
Merge branch 'maint'
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/utils/atomic.hpp11
-rw-r--r--host/lib/transport/super_recv_packet_handler.hpp2
-rw-r--r--host/lib/transport/super_send_packet_handler.hpp2
3 files changed, 15 insertions, 0 deletions
diff --git a/host/include/uhd/utils/atomic.hpp b/host/include/uhd/utils/atomic.hpp
index dc1790c3f..7a81d8d5e 100644
--- a/host/include/uhd/utils/atomic.hpp
+++ b/host/include/uhd/utils/atomic.hpp
@@ -82,12 +82,23 @@ namespace uhd{
_count.write(size);
}
+ /*!
+ * Force the barrier wait to throw a boost::thread_interrupted
+ * The threads were not getting the interruption_point on windows.
+ */
+ void interrupt(void)
+ {
+ _count.write(boost::uint32_t(~0));
+ }
+
//! Wait on the barrier condition
UHD_INLINE void wait(void){
_count.dec();
_count.cas(_size, 0);
while (_count.read() != _size){
boost::this_thread::interruption_point();
+ if (_count.read() == boost::uint32_t(~0))
+ throw boost::thread_interrupted();
boost::this_thread::yield();
}
}
diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp
index 4b96199e2..7a1972690 100644
--- a/host/lib/transport/super_recv_packet_handler.hpp
+++ b/host/lib/transport/super_recv_packet_handler.hpp
@@ -79,6 +79,8 @@ public:
}
~recv_packet_handler(void){
+ _task_barrier_entry.interrupt();
+ _task_barrier_exit.interrupt();
_task_handlers.clear();
}
diff --git a/host/lib/transport/super_send_packet_handler.hpp b/host/lib/transport/super_send_packet_handler.hpp
index 8f943effb..74e893e67 100644
--- a/host/lib/transport/super_send_packet_handler.hpp
+++ b/host/lib/transport/super_send_packet_handler.hpp
@@ -61,6 +61,8 @@ public:
}
~send_packet_handler(void){
+ _task_barrier_entry.interrupt();
+ _task_barrier_exit.interrupt();
_task_handlers.clear();
}