* configure.ac (GC_WIN32_PTHREADS): Fix pthreads-win32 name.
* doc/README.macros (GC_WIN32_PTHREADS): Likewise.
* doc/README.win32: Likewise.
* include/gc.h (GC_WIN32_THREADS): Likewise.
* include/gc_config_macros.h (GC_WIN32_PTHREADS): Likewise.
* include/private/gc_locks.h (NUMERIC_THREAD_ID): Likewise.
* win32_threads.c (GC_pthread_join): Likewise.
* doc/README.win32: Add information how to build for Win32 with
pthreads-win32 using configure.
* include/private/gc_locks.h (NUMERIC_THREAD_ID): Adjust comment
(capitalize 1st word of a sentence, add dot at sentence end).
* win32_threads.c (GC_pthread_join): Join adjacent GC_WIN32_PTHREADS
checks; refine comment about pthreads-win32 id.
AH_TEMPLATE([GC_OSF1_THREADS], [Define to support Tru64 pthreads.])
AH_TEMPLATE([GC_SOLARIS_THREADS], [Define to support Solaris pthreads.])
AH_TEMPLATE([GC_WIN32_THREADS], [Define to support Win32 threads.])
-AH_TEMPLATE([GC_WIN32_PTHREADS], [Define to support win32-pthreads.])
+AH_TEMPLATE([GC_WIN32_PTHREADS], [Define to support pthreads-win32.])
AH_TEMPLATE([GC_RTEMS_PTHREADS], [Define to support rtems-pthreads.])
dnl System header feature requests.
;;
*-*-mingw*)
AC_DEFINE(GC_WIN32_PTHREADS)
- # Using win32-pthreads
+ # Using pthreads-win32 library.
if test "${enable_parallel_mark}" != no; then
AC_DEFINE(PARALLEL_MARK)
fi
GC_WIN32_THREADS Enables support for Win32 threads. That makes sense
for this Makefile only under Cygwin.
-GC_WIN32_PTHREADS Enables support for Ming32 pthreads. This cannot be
+GC_WIN32_PTHREADS Enables support for pthreads-win32. This cannot be
enabled automatically by GC_THREADS, which would assume Win32 native
threads.
crash in the GC, since it makes it impossible for the collector to
correctly track threads.
-To build the collector for Mingw32 Pthreads, use Makefile.direct and
-explicitly set GC_WIN32_PTHREADS. Use -DPTW32_STATIC_LIB for the static
-threads library.
+To build the collector for MinGW pthreads-win32,
+use Makefile.direct and explicitly set
+GC_WIN32_PTHREADS (or pass --enable-threads=pthreads to configure).
+Use -DPTW32_STATIC_LIB for the static threads library.
#if defined(GC_WIN32_THREADS) \
&& (!defined(GC_PTHREADS) || defined(GC_BUILD) || defined(WINAPI))
- /* Note: for Cygwin and win32-pthread, this is skipped */
+ /* Note: for Cygwin and pthreads-win32, this is skipped */
/* unless windows.h is included before gc.h. */
# if !defined(GC_NO_THREAD_DECLS) || defined(GC_BUILD)
#endif
#if defined(GC_WIN32_PTHREADS) && !defined(GC_WIN32_THREADS)
- /* Using pthreads-w32 library. */
+ /* Using pthreads-win32 library. */
# define GC_WIN32_THREADS
#endif
/* structure. It also helps if comparisons don't involve a */
/* function call. Hence we introduce platform-dependent macros */
/* to compare pthread_t ids and to map them to integers. */
- /* the mapping to integers does not need to result in different */
+ /* The mapping to integers does not need to result in different */
/* integers for each thread, though that should be true as much */
/* as possible. */
- /* Refine to exclude platforms on which pthread_t is struct */
+ /* Refine to exclude platforms on which pthread_t is struct. */
# if !defined(GC_WIN32_PTHREADS)
# define NUMERIC_THREAD_ID(id) ((unsigned long)(id))
# define THREAD_EQUAL(id1, id2) ((id1) == (id2))
# define NUMERIC_THREAD_ID_UNIQUE
# else
# define NUMERIC_THREAD_ID(id) ((unsigned long)(id.p))
- /* Using documented internal details of win32-pthread library. */
+ /* Using documented internal details of pthreads-win32 library. */
/* Faster than pthread_equal(). Should not change with */
- /* future versions of win32-pthread library. */
+ /* future versions of pthreads-win32 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 */
# ifndef GC_WIN32_PTHREADS
while ((t = GC_lookup_pthread(pthread_id)) == 0)
Sleep(10);
-# endif
-
- result = pthread_join(pthread_id, retval);
-
-# ifdef GC_WIN32_PTHREADS
- /* win32_pthreads id are unique */
+ result = pthread_join(pthread_id, retval);
+# else
+ result = pthread_join(pthread_id, retval);
+ /* pthreads-win32 id are unique (not recycled) */
t = GC_lookup_pthread(pthread_id);
if (NULL == t) ABORT("Thread not registered");
# endif
+
LOCK();
GC_delete_gc_thread_no_free(t);
GC_INTERNAL_FREE(t);