[前][次][番号順一覧][スレッド一覧]

ruby-changes:66445

From: Nobuyoshi <ko1@a...>
Date: Wed, 9 Jun 2021 12:34:09 +0900 (JST)
Subject: [ruby-changes:66445] 73f9831a57 (master): POSIX timer cannot be shared in forked process [Bug #17941]

https://git.ruby-lang.org/ruby.git/commit/?id=73f9831a57

From 73f9831a57e133ab5645221df862a176a42f6685 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 9 Jun 2021 12:32:18 +0900
Subject: POSIX timer cannot be shared in forked process [Bug #17941]

---
 thread_pthread.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/thread_pthread.c b/thread_pthread.c
index 8e98307..4be3f10 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1836,6 +1836,7 @@ ubf_timer_disarm(void) https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1836
 #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 */
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]