aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 22:19:54 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 22:19:54 +0000
commitaa2f7d5bc749ccb7102c6b2fa09dfe9febc597c4 (patch)
tree8ad7d8e47151884cef3c15cbf0f5d3aa1887be2d /thread_pthread.c
parentb56c89711391e04307dd1614b445e55beb4afc04 (diff)
downloadruby-aa2f7d5bc749ccb7102c6b2fa09dfe9febc597c4.tar.gz
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 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);
}