Skip to content

Commit e739dc1

Browse files
authored
hid_close will close immediately on win32
see signal11/hidapi#416 In multi-thread environment, if the hid_read thread is different from the hid_close thread, the hid_read function will block the thread exiting, at the wait object operation. This fix just set the event, after cancel io, so that, hid_read not wait anymore and exiting read
1 parent 5447bde commit e739dc1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

windows/hid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ void HID_API_EXPORT HID_API_CALL hid_close(hid_device *dev)
823823
if (!dev)
824824
return;
825825
CancelIo(dev->device_handle);
826+
SetEvent(dev->ol.hEvent);
826827
free_hid_device(dev);
827828
}
828829

0 commit comments

Comments
 (0)