@@ -394,7 +394,6 @@ rust_task::start(spawn_fn spawnee_fn,
394
394
void rust_task::start ()
395
395
{
396
396
transition (&sched->newborn_tasks , &sched->running_tasks );
397
- sched->lock .signal ();
398
397
}
399
398
400
399
// Only run this on the rust stack
@@ -429,8 +428,6 @@ rust_task::kill() {
429
428
// Unblock the task so it can unwind.
430
429
unblock ();
431
430
432
- sched->lock .signal ();
433
-
434
431
LOG (this , task, " preparing to unwind task: 0x%" PRIxPTR, this );
435
432
// run_on_resume(rust_unwind_glue);
436
433
}
@@ -551,6 +548,7 @@ rust_task::transition(rust_task_list *src, rust_task_list *dst) {
551
548
src->remove (this );
552
549
dst->append (this );
553
550
state = dst;
551
+ sched->lock .signal ();
554
552
if (unlock)
555
553
sched->lock .unlock ();
556
554
}
@@ -578,20 +576,16 @@ rust_task::wakeup(rust_cond *from) {
578
576
(uintptr_t ) cond, (uintptr_t ) from);
579
577
A (sched, cond == from, " Cannot wake up blocked task on wrong condition." );
580
578
581
- transition (&sched->blocked_tasks , &sched->running_tasks );
582
- I (sched, cond == from);
583
579
cond = NULL ;
584
580
cond_name = " none" ;
585
-
586
- sched->lock .signal ();
581
+ transition (&sched->blocked_tasks , &sched->running_tasks );
587
582
}
588
583
589
584
void
590
585
rust_task::die () {
591
586
I (sched, !lock.lock_held_by_current_thread ());
592
587
scoped_lock with (lock);
593
588
transition (&sched->running_tasks , &sched->dead_tasks );
594
- sched->lock .signal ();
595
589
}
596
590
597
591
void
0 commit comments