-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guard against getting stuck while handling events
Alba Mendez (user mildsunrise) reports that a thread can get stuck at a specific point while handling events, thus preventing other events from being handled. This change addresses two such points in the code: 1) When processing completed transfers in handle_event_trigger(), the function wll loop for as long as the completed_transfers list is not empty. Since the event data lock is released and reacquired for each completed transfer, it is possible for the completed_transfers list to never be emptied. Address this by cutting the list and only process the transfers that have completed at that point in time. 2) When processing events, the Linux backend will reap transfers for each device that indicates activity until the reap fails (either because there are no completed transfers or some other error occurs). It is possible for transfers to be reaped at a rate slower than that at which they are completing, thus preventing the loop from exiting. Address this by limiting the number of transfers reaped for each device to 25 for every call to the Linux backend's handle_events() function. Closes #780 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
- Loading branch information
Showing
4 changed files
with
38 additions
and
12 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#define LIBUSB_NANO 11552 | ||
#define LIBUSB_NANO 11553 |