summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-11-22 08:39:20 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-11-22 13:43:09 +0400
commit37d8fb73e7210509bdc5f3e69b1ec5f8dcc6bda0 (patch)
treed47cc9ab866629c74fcd41b3b2ffbc99e762fec9 /pthread_support.c
parent0a420dc3f8b69a5675b504f7975d170ee79f1ee2 (diff)
downloadbdwgc-37d8fb73e7210509bdc5f3e69b1ec5f8dcc6bda0.tar.gz
Prevent POSIX fork if mprotect_thread is started (Darwin)
* pthread_support.c (GC_atfork_prepare): Abort if GC_dirty_maintained is set for Darwin (only if MPROTECT_VDB) since graceful suspend/resume of mprotect_thread is unsupported at present.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pthread_support.c b/pthread_support.c
index f270b59e..c65ecfab 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -996,6 +996,12 @@ static void fork_child_proc(void)
/* Routines for fork handling by client (no-op if pthread_atfork works). */
GC_API void GC_CALL GC_atfork_prepare(void)
{
+# if defined(GC_DARWIN_THREADS) && defined(MPROTECT_VDB)
+ if (GC_dirty_maintained) {
+ GC_ASSERT(0 == GC_handle_fork);
+ ABORT("Unable to fork while mprotect_thread is running");
+ }
+# endif
if (GC_handle_fork <= 0)
fork_prepare_proc();
}