summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-02-24 11:34:34 +0100
committerIvan Maidanski <ivmai@mail.ru>2012-02-24 12:52:36 +0100
commitfdb3880ec542e6d7498925e14702fb36306f816c (patch)
tree028077533e3efa299769cffb800884c0eb79cfa0 /include
parentf5af75622d75534e34d2739d3f638c429e993691 (diff)
Fix Cygwin support to handle fork() properly
(Apply commit 11e95a1 from 'master' branch) * include/private/gcconfig.h (HANDLE_FORK): Define also for Cygwin (but not for win32-pthreads). * win32_threads.c: Include unistd.h if HANDLE_FORK (for pthread_atfork). * win32_threads.c (GC_wait_for_gc_completion): Add wait_for_all argument. * win32_threads.c (GC_unregister_my_thread, GC_thread_exit_proc): Pass FALSE ("wait_for_all" argument) to GC_wait_for_gc_completion. * win32_threads.c (GC_remove_all_threads_but_me, GC_fork_prepare_proc, GC_fork_parent_proc, GC_fork_child_proc): New functions (similar to that in pthread_support.c) if HANDLE_FORK. * win32_threads.c (GC_thr_init): Invoke pthread_atfork if HANDLE_FORK.
Diffstat (limited to 'include')
-rw-r--r--include/private/gcconfig.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index 3ab7156..1cfa835 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -2591,9 +2591,9 @@
# define IF_CANCEL(x) /* empty */
#endif
-#if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) \
- && !defined(HANDLE_FORK) && !defined(NO_HANDLE_FORK) \
- && !defined(HURD) && !defined(NACL) && !defined(PLATFORM_ANDROID)
+#if !defined(HANDLE_FORK) && !defined(NO_HANDLE_FORK) && defined(GC_PTHREADS) \
+ && !defined(HURD) && !defined(NACL) && !defined(PLATFORM_ANDROID) \
+ && !defined(GC_WIN32_PTHREADS)
/* Attempts (where supported) to make GC_malloc work in a child */
/* process fork'ed from a multi-threaded parent. */
# define HANDLE_FORK