summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-06-10 10:31:27 +0900
committernagachika <nagachika@ruby-lang.org>2021-06-10 10:31:27 +0900
commitd4f4ae599f650feb0a9da6fa486ce425dbe8a81a (patch)
tree46ddb53188b4ff41c0a92137b51cad1472b1a99e /thread_pthread.c
parent2dd18df4a35a4b2dd0cf2dec7759898246fc6935 (diff)
merge revision(s) 73f9831a57e133ab5645221df862a176a42f6685: [Backport #17941]
POSIX timer cannot be shared in forked process [Bug #17941] --- thread_pthread.c | 1 + 1 file changed, 1 insertion(+)
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 97879f559a..134d1875cb 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1759,6 +1759,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 = ATOMIC_CAS(timer_posix.state, RTIMER_ARMED, RTIMER_DISARM);
switch (prev) {
case RTIMER_DISARM: return; /* likely */