Eric Wong <normalperson / yhbt.net> 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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>