summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-03-07 18:36:19 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:56 +0200
commit3da6257debbf51b1478c877ca0d154cff731af3f (patch)
treec7694d982301de7fd9d7a8da747fc2f7562a6f07 /win32_threads.c
parentba41f966c4d3041e54117cdeb29b0ad53b8d8dc9 (diff)
2011-03-07 Ivan Maidanski <ivmai@mail.ru>
* dyn_load.c (GC_MUST_RESTORE_REDEFINED_DLOPEN): Test GC_NO_DLOPEN. * gc_dlopen.c: Ditto. * include/gc_pthread_redirects.h (GC_dlopen, dlopen): Ditto. * gc_dlopen.c: Don't include dlfcn.h (as it is included in gc_pthread_redirects.h). * pthread_support.c (pthread_sigmask, GC_pthread_sigmask_t, GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of GC_DARWIN_THREADS, GC_OPENBSD_THREADS and NACL). * include/gc_pthread_redirects.h (GC_pthread_sigmask, pthread_sigmask): Ditto. * win32_threads.c (pthread_sigmask, GC_pthread_sigmask): Test GC_NO_PTHREAD_SIGMASK (instead of GC_WIN32_PTHREADS); reformat the comment. * pthread_support.c (pthread_create, GC_pthread_create_t, GC_pthread_create): Rename GC_PTHREAD_CONST to GC_PTHREAD_CREATE_CONST. * win32_threads.c (GC_pthread_create): Ditto. * include/gc_pthread_redirects.h: Ditto. * include/gc_pthread_redirects.h (GC_NO_DLOPEN, GC_NO_PTHREAD_SIGMASK): New macro defined. * include/gc_pthread_redirects.h (GC_PTHREAD_CREATE_CONST): Set to empty for NaCl. * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_ATTRIBUTE): Do not define for Android (as CANCEL_SAFE is not defined).
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 7872f4a..f7f74ea 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -40,10 +40,13 @@
/* Cygwin-specific forward decls */
# undef pthread_create
-# undef pthread_sigmask
# undef pthread_join
# undef pthread_detach
+# ifndef GC_NO_PTHREAD_SIGMASK
+# undef pthread_sigmask
+# endif
+
# ifdef DEBUG_THREADS
# ifdef CYGWIN32
# define DEBUG_CYGWIN_THREADS 1
@@ -2387,7 +2390,7 @@ GC_INNER void GC_thr_init(void)
/* Cygwin-pthreads calls CreateThread internally, but it's not easily */
/* interceptible by us..., so intercept pthread_create instead. */
GC_API int GC_pthread_create(pthread_t *new_thread,
- GC_PTHREAD_CONST pthread_attr_t *attr,
+ GC_PTHREAD_CREATE_CONST pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg)
{
if (!parallel_initialized) GC_init_parallel();
@@ -2518,16 +2521,16 @@ GC_INNER void GC_thr_init(void)
UNLOCK();
}
-# ifndef GC_WIN32_PTHREADS
- /* win32 pthread does not support sigmask */
- /* nothing required here... */
+# ifndef GC_NO_PTHREAD_SIGMASK
+ /* Win32 pthread does not support sigmask. */
+ /* So, nothing required here... */
GC_API int GC_pthread_sigmask(int how, const sigset_t *set,
sigset_t *oset)
{
if (!parallel_initialized) GC_init_parallel();
return pthread_sigmask(how, set, oset);
}
-# endif
+# endif /* !GC_NO_PTHREAD_SIGMASK */
GC_API int GC_pthread_detach(pthread_t thread)
{