commit | a5f6a43342d6bd0da57092ec4e1a6bce30bb2bce | [log] [tgz] |
---|---|---|
author | Chris Dickens <christopher.a.dickens@gmail.com> | Fri Jan 24 11:51:55 2020 -0800 |
committer | Chris Dickens <christopher.a.dickens@gmail.com> | Fri Feb 07 15:56:05 2020 -0800 |
tree | fcff5e76bddf71a765bfd66c44c96e6e102019ba | |
parent | 9c28ad219b654011783a42ec888ca87dbda704a6 [diff] |
threads_posix: Use thread-local storage to cache thread ID Trying to capture debug logs that reproduce a problem can be tricky. Turning up the debug level will automatically make the program a bit slower. This alone cane make timing-sensitive bugs "disappear" when capturing logs. One of the hot paths for debug messages is fetching the thread ID, which is immeasurably helpful in understanding thread interactions within the library. Unfortunately most implementations require a system call to fetch the executing thread's ID, which isn't exactly going to help in the way of execution time. Add a check for thread-local storage support when configuring the library to build. If the toolchain provides this support, only one system call will be required per thread. This check is only done for non-Windows systems because thread-local storage is inefficiently implemented on MinGW. Closes #682 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD and Haiku userspace. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).
libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.
libusb homepage: http://libusb.info/
Developers will wish to consult the API documentation: http://api.libusb.info
Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info
(Please use the mailing list rather than mailing developers directly)