From 8da12db13d3410b56dd7afdac73eee28318e1b70 Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 13 Aug 2018 22:19:54 +0000 Subject: 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 --- thread_pthread.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'thread_pthread.c') diff --git a/thread_pthread.c b/thread_pthread.c index eb639d06aa..bcf412bc2f 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); } -- cgit v1.2.3