From: Eric Wong Date: 2018-06-20T10:36:41+00:00 Subject: [ruby-core:87530] Re: [Ruby trunk Bug#14841] Very rarely IO#readpartial does not raise EOFError Eric Wong wrote: > mofezilla@gmail.com wrote: > > https://bugs.ruby-lang.org/issues/14841 > > Can you test? Sorry, right idea, bad patch (broke during "make exam") This should work: ``` --- a/thread_sync.c +++ b/thread_sync.c @@ -289,8 +289,11 @@ rb_mutex_lock(VALUE self) th->vm->sleeper--; if (mutex->th == th) mutex_locked(th, self); - - RUBY_VM_CHECK_INTS_BLOCKING(th->ec); + RUBY_VM_CHECK_INTS_BLOCKING(th->ec); /* may release mutex */ + if (!mutex->th) { + mutex->th = th; + mutex_locked(th, self); + } } } return self; ``` Unsubscribe: