summaryrefslogtreecommitdiff
path: root/lib/glthread/thread.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-06-09 12:40:44 +0200
committerBruno Haible <bruno@clisp.org>2011-06-09 12:56:17 +0200
commitf462d86108d41b1ca0f48b51caad6c696d67d8fd (patch)
tree94d3b0ebca1dd100a02f6616c0fa91fb64febdab /lib/glthread/thread.c
parent5f0441a0bef4d7a8af4e3ba8b24a948e5cccd71c (diff)
downloadgnulib-f462d86108d41b1ca0f48b51caad6c696d67d8fd.tar.gz
thread: Support pthreads-win32.
* lib/glthread/thread.h (gl_thread_self): Define differently on pthreads-win32. (gl_null_thread): New declaration. (gl_thread_self_pointer): New macro. * lib/glthread/thread.c (gl_null_thread): New constant. * tests/test-lock.c: Use gl_thread_self_pointer instead of gl_thread_self. * tests/test-tls.c: Likewise. Suggested by Paul Eggert. Reported by Eric Blake.
Diffstat (limited to 'lib/glthread/thread.c')
-rw-r--r--lib/glthread/thread.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/glthread/thread.c b/lib/glthread/thread.c
index 6b134a7074..d6af6f35f4 100644
--- a/lib/glthread/thread.c
+++ b/lib/glthread/thread.c
@@ -29,6 +29,20 @@
/* ========================================================================= */
+#if USE_POSIX_THREADS
+
+#include <pthread.h>
+
+#ifdef PTW32_VERSION
+
+const gl_thread_t gl_null_thread /* = { .p = NULL } */;
+
+#endif
+
+#endif
+
+/* ========================================================================= */
+
#if USE_WIN32_THREADS
#include <process.h>