summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 22:19:54 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 22:19:54 (GMT)
commit8da12db13d3410b56dd7afdac73eee28318e1b70 (patch)
tree8ad7d8e47151884cef3c15cbf0f5d3aa1887be2d /thread_pthread.c
parent3dd6288d7375ddb2a84cdec4192a6f71c7461b28 (diff)
thread_pthread (rb_timer_arm): ignore UBF_TIMER_POSIX state 2
It looks like I forgot to account for a situation involving 3 threads. [ruby-core:88360] [Misc #14937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index eb639d0..bcf412b 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1386,7 +1386,13 @@ rb_timer_arm(rb_pid_t current) /* async signal safe */
case 1: return; /* success */
case 2:
- rb_async_bug_errno("UBF_TIMER_POSIX state 2 unexpected", EINVAL);
+ /*
+ * it is possible to have another thread disarm, and
+ * a third thread arm finish re-arming before we get
+ * here, so we wasted a syscall with timer_settime but
+ * probably unavoidable in a signal handler.
+ */
+ return;
default:
rb_async_bug_errno("UBF_TIMER_POSIX unknown state", ERANGE);
}