summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libusb/os/linux_udev.c11
-rw-r--r--libusb/version_nano.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/libusb/os/linux_udev.c b/libusb/os/linux_udev.c
index 29c949a..abecdd4 100644
--- a/libusb/os/linux_udev.c
+++ b/libusb/os/linux_udev.c
@@ -119,16 +119,17 @@ int linux_udev_stop_event_monitor(void)
assert(udev_monitor != NULL);
assert(udev_monitor_fd != -1);
- /* Cancel the event thread. This is the only way to garauntee the thread
- exits since closing the monitor fd won't necessarily cause poll
- to return. */
- pthread_cancel(linux_event_thread);
-
/* Release the udev monitor */
udev_monitor_unref(udev_monitor);
udev_monitor = NULL;
udev_monitor_fd = -1;
+ /* Cancel the event thread. This is the only way to garauntee the
+ thread exits since closing the monitor fd won't necessarily cause
+ poll to return. */
+ pthread_cancel(linux_event_thread);
+ pthread_join(linux_event_thread, NULL);
+
/* Clean up the udev context */
udev_unref(udev_ctx);
udev_ctx = NULL;
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 6447594..3d5965f 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10737
+#define LIBUSB_NANO 10738