Darwin: Fix incorrect mutex protection of libusb_darwin_acfl global
authorSean McBride <sean@rogue-research.com>
Fri, 9 Dec 2011 18:43:46 +0000 (13:43 -0500)
committerPeter Stuge <peter@stuge.se>
Wed, 8 Feb 2012 14:42:27 +0000 (15:42 +0100)
libusb/os/darwin_usb.c

index 58c4c88..f092562 100644 (file)
@@ -358,11 +358,9 @@ static void *event_thread_main (void *arg0) {
 
   usbi_info (ctx, "thread ready to receive events");
 
-  /* let the main thread know about the async runloop */
-  libusb_darwin_acfl = runloop;
-
   /* signal the main thread */
   pthread_mutex_lock (&libusb_darwin_at_mutex);
+  libusb_darwin_acfl = runloop;
   pthread_cond_signal (&libusb_darwin_at_cond);
   pthread_mutex_unlock (&libusb_darwin_at_mutex);