summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-09 12:32:18 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-06-09 12:32:18 +0900
commit73f9831a57e133ab5645221df862a176a42f6685 (patch)
treedc051788f728f5b7dd997e6cb088c367447762c9 /thread_pthread.c
parent9f110ced578ec944f7f7cbe11ba3519a25adf714 (diff)
downloadruby-73f9831a57e133ab5645221df862a176a42f6685.tar.gz
POSIX timer cannot be shared in forked process [Bug #17941]
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 8e983076b6..4be3f10bf8 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1836,6 +1836,7 @@ ubf_timer_disarm(void)
#if UBF_TIMER == UBF_TIMER_POSIX
rb_atomic_t prev;
+ if (timer_posix.owner && timer_posix.owner != getpid()) return;
prev = timer_state_cas(RTIMER_ARMED, RTIMER_DISARM);
switch (prev) {
case RTIMER_DISARM: return; /* likely */