diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-31 13:49:13 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-31 13:49:13 +0000 |
commit | c5a99cf3c0d493e911f499fdecdd0db68019af98 (patch) | |
tree | cc425c4cd02a8530ae392f92779576e934b94db5 | |
parent | cce645e6a7b1819922c3e9fa2c5bff0bc6d5dfa5 (diff) |
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
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | thread_pthread.c | 16 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 20 insertions, 7 deletions
@@ -1,3 +1,12 @@ +Wed Jan 31 22:48:41 2018 Eric Wong <normalperson@yhbt.net> + + 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 <Rei.Odaira@gmail.com> * 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 */ @@ -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 |