summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--thread_pthread.c16
-rw-r--r--version.h2
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 <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 */
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