From c5a99cf3c0d493e911f499fdecdd0db68019af98 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 31 Jan 2018 13:49:13 +0000 Subject: merge revision(s) 60079: [Backport #13794] thread_pthread.c: do not wakeup inside child processes * thread_pthread.c (rb_thread_wakeup_timer_thread): check ownership before incrementing (rb_thread_wakeup_timer_thread_low): ditto [Bug #13794] [ruby-core:83064] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ thread_pthread.c | 16 ++++++++++------ version.h | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 049c403352..21d9585e9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Jan 31 22:48:41 2018 Eric Wong + + thread_pthread.c: do not wakeup inside child processes + + * thread_pthread.c (rb_thread_wakeup_timer_thread): check + ownership before incrementing + (rb_thread_wakeup_timer_thread_low): ditto + [Bug #13794] [ruby-core:83064] + Wed Jan 31 22:46:36 2018 Rei Odaira * configure.in (rb_cv_lgamma_r_pm0): check if lgamma_r(+0.0) diff --git a/thread_pthread.c b/thread_pthread.c index 9b58cd7050..58648975c9 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1313,17 +1313,21 @@ void rb_thread_wakeup_timer_thread(void) { /* must be safe inside sighandler, so no mutex */ - ATOMIC_INC(timer_thread_pipe.writing); - rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.normal[1]); - ATOMIC_DEC(timer_thread_pipe.writing); + if (timer_thread_pipe.owner_process == getpid()) { + ATOMIC_INC(timer_thread_pipe.writing); + rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.normal[1]); + ATOMIC_DEC(timer_thread_pipe.writing); + } } static void rb_thread_wakeup_timer_thread_low(void) { - ATOMIC_INC(timer_thread_pipe.writing); - rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.low[1]); - ATOMIC_DEC(timer_thread_pipe.writing); + if (timer_thread_pipe.owner_process == getpid()) { + ATOMIC_INC(timer_thread_pipe.writing); + rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.low[1]); + ATOMIC_DEC(timer_thread_pipe.writing); + } } /* VM-dependent API is not available for this function */ diff --git a/version.h b/version.h index 50bc5a0baa..ed294a06b9 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.7" #define RUBY_RELEASE_DATE "2018-01-31" -#define RUBY_PATCHLEVEL 403 +#define RUBY_PATCHLEVEL 404 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 1 -- cgit v1.2.3