Skip to content

Commit 5f8f606

Browse files
author
Jacob Lacouture
committed
f
1 parent 9a2c249 commit 5f8f606

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
@@ -1275,6 +1275,8 @@ deferred_wait_thread_enqueue_yield(struct rb_thread_sched *sched, rb_thread_t *t
12751275

12761276
sched->deferred_wait_th = th;
12771277
sched->deferred_wait_seq1 += 1;
1278+
// Mark the thread as stopped even though it's not really stopped.
1279+
th->status = THREAD_STOPPED_FOREVER;
12781280

12791281
// Only link if we're not already linked and the background thread is running.
12801282
if (!ccan_node_linked(&sched->deferred_wait_link) && thread_deferred_wait.running) {
@@ -1289,8 +1291,6 @@ deferred_wait_thread_enqueue_yield(struct rb_thread_sched *sched, rb_thread_t *t
12891291
ccan_list_add(&thread_deferred_wait.q_head, &sched->deferred_wait_link);
12901292
rb_native_cond_signal(&thread_deferred_wait.cond);
12911293
rb_native_mutex_unlock(&thread_deferred_wait.lock);
1292-
// Mark the thread as stopped even though it's not really stopped.
1293-
th->status = THREAD_STOPPED_FOREVER;
12941294
}
12951295
return true;
12961296
}

0 commit comments

Comments
 (0)