diff options
author | Sean McBride <sean@rogue-research.com> | 2011-12-09 13:43:46 -0500 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2012-02-08 15:37:03 +0100 |
commit | 662ced422cf1ffce68753296a81dccf87f3a1c57 (patch) | |
tree | 5cb055a0ce513403f2a8a0e31550fdebbb16a938 /libusb/os/darwin_usb.c | |
parent | 952a9bb6116afc69c4bae4714c2eb0713bf62a6d (diff) | |
download | libusbx-662ced422cf1ffce68753296a81dccf87f3a1c57.tar.gz |
Darwin: Use retained runloop variable instead of CFRunLoopGetCurrent()
Diffstat (limited to 'libusb/os/darwin_usb.c')
-rw-r--r-- | libusb/os/darwin_usb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c index ca93ad4..58c4c88 100644 --- a/libusb/os/darwin_usb.c +++ b/libusb/os/darwin_usb.c @@ -339,7 +339,7 @@ static void *event_thread_main (void *arg0) { /* add the notification port to the run loop */ libusb_notification_port = IONotificationPortCreate (kIOMasterPortDefault); libusb_notification_cfsource = IONotificationPortGetRunLoopSource (libusb_notification_port); - CFRunLoopAddSource(CFRunLoopGetCurrent (), libusb_notification_cfsource, kCFRunLoopDefaultMode); + CFRunLoopAddSource(runloop, libusb_notification_cfsource, kCFRunLoopDefaultMode); /* create notifications for removed devices */ kresult = IOServiceAddMatchingNotification (libusb_notification_port, kIOTerminatedNotification, @@ -359,7 +359,7 @@ 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 = CFRunLoopGetCurrent (); + libusb_darwin_acfl = runloop; /* signal the main thread */ pthread_mutex_lock (&libusb_darwin_at_mutex); |