summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-05 22:58:13 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-05 22:58:13 +0000
commit1b455428d311a7c2e562a72960a916f8be606b8f (patch)
tree24a46354899d1af71e2cf100dd36be4125766cb5 /thread.c
parent4f125262f442ca575415d5ff413c024ba26f6b04 (diff)
thread.c: reset waitq of keeping mutexes in child
We must not maintain references to threads in the parent process in any mutexes held by the child process. * thread_sync.c (rb_mutex_cleanup_keeping_mutexes): new function * thread.c (rb_thread_atfork): cleanup keeping mutexes [ruby-core:85940] [Bug #14578] Fixes: r58604 (commit 3586c9e0876e784767a1c1adba9ebc2499fa0ec2) ("reduce rb_mutex_t size from 160 to 80 bytes on 64-bit") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 27f5e5dabf..2c06127292 100644
--- a/thread.c
+++ b/thread.c
@@ -4236,6 +4236,7 @@ rb_thread_atfork(void)
rb_thread_t *th = GET_THREAD();
rb_thread_atfork_internal(th, terminate_atfork_i);
th->join_list = NULL;
+ rb_mutex_cleanup_keeping_mutexes(th);
/* We don't want reproduce CVE-2003-0900. */
rb_reset_random_seed();