ruby-changes:52146
From: normal <ko1@a...>
Date: Tue, 14 Aug 2018 07:20:01 +0900 (JST)
Subject: [ruby-changes:52146] normal:r64354 (trunk): thread_pthread (rb_timer_arm): ignore UBF_TIMER_POSIX state 2
normal 2018-08-14 07:19:54 +0900 (Tue, 14 Aug 2018) New Revision: 64354 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64354 Log: 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] Modified files: trunk/thread_pthread.c Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 64353) +++ thread_pthread.c (revision 64354) @@ -1386,7 +1386,13 @@ rb_timer_arm(rb_pid_t current) /* async https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L1386 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/