Skip to content

Commit 9a6c8d7

Browse files
author
Jacob Lacouture
committed
the actual fix
1 parent 6dde832 commit 9a6c8d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

thread_pthread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,8 @@ deferred_wait_thread_enqueue_yield(struct rb_thread_sched *sched, rb_thread_t *t
14391439
sched->deferred_wait_th = th;
14401440
sched->deferred_wait_seq1 += 1;
14411441

1442-
// Only link if we're not already linked.
1443-
if (!ccan_node_linked(&sched->deferred_wait_link)) {
1442+
// Only link if we're not already linked and the background thread is running.
1443+
if (!ccan_node_linked(&sched->deferred_wait_link) && thread_deferred_wait.running) {
14441444
rb_native_mutex_lock(&thread_deferred_wait.lock);
14451445
// We held the sched lock while waiting for the mutex so we should not have been unlinked.
14461446
VM_ASSERT(!ccan_node_linked(&sched->deferred_wait_link));

0 commit comments

Comments
 (0)