-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
device.hardware: interrupt USB polling thread before threading shutdown.
While performing `USBContext.handleEvents()` the poller thread is uninterruptible other than through libusb1 API. Since the Python runtime joins all non-daemon threads on threading shutdown it is necessary to interrupt the thread by calling the corresponding libusb1 function. A seemingly obvious solution is to make the thread a daemon thread so that it is not joined on threading shutdown. Unfortunately this only makes the problem worse. All daemon threads are instantly killed on shutdown, leaving a lock within libusb1 permanently taken, and causing a hang later when python-libusb1 objects are garbage collected by the main thread. Fixes #413.
- Loading branch information
1 parent
5a9b10f
commit 23f815f
Showing
3 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters