File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1271,7 +1271,9 @@ static void* hotplug_thread(void* user_data)
12711271 libusb_hotplug_deregister_callback (hid_hotplug_context .context , hid_hotplug_context .callback_handle );
12721272 libusb_exit (hid_hotplug_context .context );
12731273
1274- /* Forcibly wake up the thread so it can shut down immediately and wait for it to stop */
1274+ /* hotplug_cbs is already NULL here (the loop above exited because of that).
1275+ * Signal callback_thread under the mutex so it can observe the NULL hotplug_cbs
1276+ * and exit cleanly, rather than waiting indefinitely in cond_wait. */
12751277 hidapi_thread_mutex_lock (& hid_hotplug_context .callback_thread );
12761278 hidapi_thread_cond_signal (& hid_hotplug_context .callback_thread );
12771279 hidapi_thread_mutex_unlock (& hid_hotplug_context .callback_thread );
You can’t perform that action at this time.
0 commit comments