From: Eric Wong Date: 2018-08-18T00:31:08+00:00 Subject: [ruby-core:88524] Re: [Ruby trunk Bug#14999] ConditionVariable doesn't reacquire the Mutex if Thread#kill-ed eregontp@gmail.com wrote: > @normalperson I added the specs in r64409. > However I just saw that the spec failed once on Ubuntu: > https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-trunk/log/20180817T213003Z.fail.html.gz It might be because of rb_funcallv switching and hitting interrupts. I think this should fix it, but it can make an incompatibility if somebody relies on redefining Mutex#sleep... ``` diff --git a/thread_sync.c b/thread_sync.c index 5e511af0db..87c17316a9 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -1358,7 +1358,7 @@ static VALUE do_sleep(VALUE args) { struct sleep_call *p = (struct sleep_call *)args; - return rb_funcallv(p->mutex, id_sleep, 1, &p->timeout); + return rb_mutex_sleep(p->mutex, p->timeout); } static VALUE ``` Unsubscribe: