summaryrefslogtreecommitdiff
path: root/Xcode
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2020-03-27 00:03:41 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2020-03-27 00:03:41 -0700
commit30b56baec51b70d5b10f1f14ff47327ecc8ebbd0 (patch)
tree1e5fbc312cff509037a75c81a24bea5708394df5 /Xcode
parent1d67425879c3ae515e97b73df94bf2e7336178b0 (diff)
downloadlibusb-30b56baec51b70d5b10f1f14ff47327ecc8ebbd0.tar.gz
threads_posix: Improve usbi_get_tid() for various platforms
Add support for real thread IDs on macOS 10.6 and later using the new pthread_threadid_np() function. Add support for thread IDs on Haiku, NetBSD and Solaris. Provide a fallback value other than -1 when direct support is not available. This should suffice as a unique identifier since pthread_t, while opaque, is still distinct amongst active threads. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'Xcode')
-rw-r--r--Xcode/config.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/Xcode/config.h b/Xcode/config.h
index 1815715..49aabfd 100644
--- a/Xcode/config.h
+++ b/Xcode/config.h
@@ -1,11 +1,6 @@
/* config.h. Manually generated for Xcode. */
-/* On 10.12 and later, use newly available clock_*() functions */
#include <AvailabilityMacros.h>
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
-/* Define to 1 if you have the `clock_gettime' function. */
-#define HAVE_CLOCK_GETTIME 1
-#endif
/* Default visibility */
#define DEFAULT_VISIBILITY /**/
@@ -13,6 +8,21 @@
/* Message logging */
#define ENABLE_LOGGING 1
+/* Define to 1 if the compiler supports _Thread_local. */
+#define HAVE_CC_THREAD_LOCAL 1
+
+/* On 10.12 and later, use newly available clock_*() functions */
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+#endif
+
+/* On 10.6 and later, use newly available pthread_threadid_np() function */
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+/* Define to 1 if you have the 'pthread_threadid_np' function. */
+#define HAVE_PTHREAD_THREADID_NP 1
+#endif
+
/* Define to 1 if the system has the type `nfds_t'. */
#define HAVE_NFDS_T 1