diff options
author | nagachika <nagachika@ruby-lang.org> | 2021-07-25 13:38:05 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-07-25 13:49:53 +0900 |
commit | 95dc88c88869541dd0eccafd14924d78c8d7f427 (patch) | |
tree | f4ad43fffd779545d16d7d47106a25c341633eb5 /thread_sync.c | |
parent | dc7ad0287eff6e11c2d0f71d2a02e56fe172a0da (diff) |
partially merge revision(s) 5f69a7f60467fa58c2f998daffab43e118bff36c: [Backport #17666]
Co-authored-by: Samuel Williams <@ioquatix>
https://github.com/nagachika/ruby/pull/1/commits/2cee515f024f3295945f312cb6b052f972f9c93d
Diffstat (limited to 'thread_sync.c')
-rw-r--r-- | thread_sync.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/thread_sync.c b/thread_sync.c index 11d77e8e91..26d5e6b686 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -32,7 +32,7 @@ sync_wakeup(struct list_head *head, long max) if (cur->th->status != THREAD_KILLED) { - if (cur->th->scheduler != Qnil) { + if (cur->th->scheduler != Qnil && rb_fiberptr_blocking(cur->fiber) == 0) { rb_scheduler_unblock(cur->th->scheduler, cur->self, rb_fiberptr_self(cur->fiber)); } else { rb_threadptr_interrupt(cur->th); @@ -437,7 +437,7 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t *th, rb_fiber_t *fiber) list_for_each_safe(&mutex->waitq, cur, next, node) { list_del_init(&cur->node); - if (cur->th->scheduler != Qnil) { + if (cur->th->scheduler != Qnil && rb_fiberptr_blocking(cur->fiber) == 0) { rb_scheduler_unblock(cur->th->scheduler, cur->self, rb_fiberptr_self(cur->fiber)); goto found; } else { |