summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorivmai <ivmai>2011-07-04 15:29:55 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:07:00 +0200
commit06c1e2cf3859e4f9cf26dfd93c4c707293754aca (patch)
treeb3f014826c539fc7489328447f1b7c2b01cbdd80 /include
parent463d083ff1404570a30cbf8f4d780d041598e9e6 (diff)
2011-07-04 Ivan Maidanski <ivmai@mail.ru> (mostly really Andy Wingo)
* configure.ac (GC_THREADS): Refine the comment. * configure.ac (GC_WIN32_PTHREADS): Add template. * configure.ac (cygwin, win32): Define GC_WIN32_THREADS instead of GC_THREADS. * configure.ac (pthreads): Add mingw target (GC_WIN32_PTHREADS). * configure: Regenerate. * include/private/config.h.in: Ditto. * include/private/gc_locks.h (GC_WIN32_PTHREADS): Remove nested test for the macro; add comment.
Diffstat (limited to 'include')
-rw-r--r--include/private/config.h.in7
-rw-r--r--include/private/gc_locks.h23
2 files changed, 14 insertions, 16 deletions
diff --git a/include/private/config.h.in b/include/private/config.h.in
index 6af87d1..a14c0f3 100644
--- a/include/private/config.h.in
+++ b/include/private/config.h.in
@@ -69,7 +69,7 @@
/* Define to support Solaris pthreads. */
#undef GC_SOLARIS_THREADS
-/* Define to support threads. */
+/* Define to support platform-specific threads. */
#undef GC_THREADS
/* See doc/README.macros. */
@@ -81,7 +81,10 @@
/* The minor version number of this GC release. */
#undef GC_VERSION_MINOR
-/* Define to support win32 threads. */
+/* Define to support win32-pthreads. */
+#undef GC_WIN32_PTHREADS
+
+/* Define to support Win32 threads. */
#undef GC_WIN32_THREADS
/* Define to 1 if you have the <dlfcn.h> header file. */
diff --git a/include/private/gc_locks.h b/include/private/gc_locks.h
index b38384c..113b4ae 100644
--- a/include/private/gc_locks.h
+++ b/include/private/gc_locks.h
@@ -99,20 +99,15 @@
# define THREAD_EQUAL(id1, id2) ((id1) == (id2))
# define NUMERIC_THREAD_ID_UNIQUE
# else
-# if defined(GC_WIN32_PTHREADS)
-# define NUMERIC_THREAD_ID(id) ((unsigned long)(id.p))
- /* Using documented internal details of win32_pthread library. */
- /* Faster than pthread_equal(). Should not change with */
- /* future versions of win32_pthread library. */
-# define THREAD_EQUAL(id1, id2) ((id1.p == id2.p) && (id1.x == id2.x))
-# undef NUMERIC_THREAD_ID_UNIQUE
-# else
- /* Generic definitions that always work, but will result in */
- /* poor performance and weak assertion checking. */
-# define NUMERIC_THREAD_ID(id) 1l
-# define THREAD_EQUAL(id1, id2) pthread_equal(id1, id2)
-# undef NUMERIC_THREAD_ID_UNIQUE
-# endif
+# define NUMERIC_THREAD_ID(id) ((unsigned long)(id.p))
+ /* Using documented internal details of win32-pthread library. */
+ /* Faster than pthread_equal(). Should not change with */
+ /* future versions of win32-pthread library. */
+# define THREAD_EQUAL(id1, id2) ((id1.p == id2.p) && (id1.x == id2.x))
+# undef NUMERIC_THREAD_ID_UNIQUE
+ /* Generic definitions based on pthread_equal() always work but */
+ /* will result in poor performance (as NUMERIC_THREAD_ID is */
+ /* defined to just a constant) and weak assertion checking. */
# endif
# define NO_THREAD ((unsigned long)(-1l))
/* != NUMERIC_THREAD_ID(pthread_self()) for any thread */