POSIX timer cannot be shared in forked process [Bug #17941]

This commit is contained in:
Nobuyoshi Nakada 2021-06-09 12:32:18 +09:00
parent 9f110ced57
commit 73f9831a57
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6
1 changed files with 1 additions and 0 deletions

View File

@ -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 */