Don't try to resume blocked fiber on dead thread.
This commit is contained in:
parent
afe3cb782b
commit
f73135233b
Notes:
git
2020-11-08 16:41:19 +09:00
@ -29,15 +29,15 @@ sync_wakeup(struct list_head *head, long max)
|
|||||||
list_for_each_safe(head, cur, next, node) {
|
list_for_each_safe(head, cur, next, node) {
|
||||||
list_del_init(&cur->node);
|
list_del_init(&cur->node);
|
||||||
|
|
||||||
if (cur->th->scheduler != Qnil) {
|
|
||||||
rb_scheduler_unblock(cur->th->scheduler, cur->self, rb_fiberptr_self(cur->fiber));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cur->th->status != THREAD_KILLED) {
|
if (cur->th->status != THREAD_KILLED) {
|
||||||
if (cur->th->scheduler == Qnil) {
|
|
||||||
|
if (cur->th->scheduler != Qnil) {
|
||||||
|
rb_scheduler_unblock(cur->th->scheduler, cur->self, rb_fiberptr_self(cur->fiber));
|
||||||
|
} else {
|
||||||
rb_threadptr_interrupt(cur->th);
|
rb_threadptr_interrupt(cur->th);
|
||||||
cur->th->status = THREAD_RUNNABLE;
|
cur->th->status = THREAD_RUNNABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (--max == 0) return;
|
if (--max == 0) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user