Skip to content

Commit cb7fd90

Browse files
committed
---
yaml --- r: 13995 b: refs/heads/try c: 5c3c8d4 h: refs/heads/master i: 13993: 83ecc78 13991: ee39245 v: v3
1 parent 1e57c6c commit cb7fd90

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 5449b886d34c1ddbba60986d56d6896543a6b87f
5+
refs/heads/try: 5c3c8d454d58b3bb4a79d36b76582f1f7761bc75
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rt/rust_kernel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ rust_kernel::release_task_id(rust_task_id id) {
191191

192192
void rust_kernel::wakeup_schedulers() {
193193
for(size_t i = 0; i < num_threads; ++i) {
194-
threads[i]->lock.signal_all();
194+
rust_scheduler *sched = threads[i];
195+
scoped_lock with(sched->lock);
196+
sched->lock.signal_all();
195197
}
196198
}
197199

branches/try/src/rt/rust_task.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ rust_task::start(spawn_fn spawnee_fn,
394394
void rust_task::start()
395395
{
396396
transition(&sched->newborn_tasks, &sched->running_tasks);
397-
sched->lock.signal();
398397
}
399398

400399
// Only run this on the rust stack
@@ -429,8 +428,6 @@ rust_task::kill() {
429428
// Unblock the task so it can unwind.
430429
unblock();
431430

432-
sched->lock.signal();
433-
434431
LOG(this, task, "preparing to unwind task: 0x%" PRIxPTR, this);
435432
// run_on_resume(rust_unwind_glue);
436433
}
@@ -551,6 +548,7 @@ rust_task::transition(rust_task_list *src, rust_task_list *dst) {
551548
src->remove(this);
552549
dst->append(this);
553550
state = dst;
551+
sched->lock.signal();
554552
if(unlock)
555553
sched->lock.unlock();
556554
}
@@ -578,20 +576,16 @@ rust_task::wakeup(rust_cond *from) {
578576
(uintptr_t) cond, (uintptr_t) from);
579577
A(sched, cond == from, "Cannot wake up blocked task on wrong condition.");
580578

581-
transition(&sched->blocked_tasks, &sched->running_tasks);
582-
I(sched, cond == from);
583579
cond = NULL;
584580
cond_name = "none";
585-
586-
sched->lock.signal();
581+
transition(&sched->blocked_tasks, &sched->running_tasks);
587582
}
588583

589584
void
590585
rust_task::die() {
591586
I(sched, !lock.lock_held_by_current_thread());
592587
scoped_lock with(lock);
593588
transition(&sched->running_tasks, &sched->dead_tasks);
594-
sched->lock.signal();
595589
}
596590

597591
void

0 commit comments

Comments
 (0)