-
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.
core: Simplify thread abstractions and add debug checks
The POSIX thread mutex initialization function can potentially fail, but in practice this is unlikely to occur. There is also inconsistent use of the result of the mutex initialization within the library. The result is only checked for mutexes in the libusb_device and libusb_device_handle structures but is ignored in all other cases. Simplify the mutex initialization function by changing the abstraction's wrapper to a void function, much like all the other functions that already exist. To that end, introduce macros for the abstractions that will check the return value on debug builds. Also remove the dependence on the core library needing errno.h to translate errors from usbi_cond_timedwait(). The abstraction will convert the implementation-specific error codes to LIBUSB_ERROR values. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
- Loading branch information
Showing
7 changed files
with
59 additions
and
61 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
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 11554 | ||
#define LIBUSB_NANO 11555 |