From 627075e60e0b893a412e849301ccef5bb2e8a68a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 22 Apr 2011 17:02:07 -0700 Subject: uhd: move thread loop condition flag to before barrier (prevents race condition) --- host/lib/transport/libusb1_zero_copy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib/transport/libusb1_zero_copy.cpp') diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index e42cab1d1..ec2077d30 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -277,10 +277,10 @@ private: bool _threads_running; void run_event_loop(boost::barrier &spawn_barrier){ + _threads_running = true; spawn_barrier.wait(); set_thread_priority_safe(); libusb_context *context = libusb::session::get_global_session()->get_context(); - _threads_running = true; try{ while(_threads_running){ timeval tv; -- cgit v1.2.3