diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-07-25 18:00:37 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-07-28 10:47:28 -0700 |
| commit | 5302cde188bba80dd38c58eaafa792d621b0818c (patch) | |
| tree | 663ca3e81a7254548e756ea0dfef66d4362f971a /src/rt/rust_task.cpp | |
| parent | e697a52359874c2b7387be96e664b1f94b14255b (diff) | |
| download | rust-5302cde188bba80dd38c58eaafa792d621b0818c.tar.gz rust-5302cde188bba80dd38c58eaafa792d621b0818c.zip | |
Made task threads wait instead of sleep, so they can be woken up. This appears to give us much better parallel performance.
Also, commented out one more unsafe log and updated rust_kernel.cpp to compile under g++
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 538a9b34e56..05efc12e4d4 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -105,7 +105,7 @@ rust_task::~rust_task() /* FIXME: tighten this up, there are some more assertions that hold at task-lifecycle events. */ - // I(sched, ref_count == 0 || + I(sched, ref_count == 0); // || // (ref_count == 1 && this == sched->root_task)); del_stk(this, stk); @@ -167,6 +167,7 @@ rust_task::start(uintptr_t spawnee_fn, yield_timer.reset_us(0); transition(&sched->newborn_tasks, &sched->running_tasks); + sched->lock.signal(); } void @@ -212,6 +213,8 @@ rust_task::kill() { if (NULL == supervisor && propagate_failure) sched->fail(); + sched->lock.signal(); + LOG(this, task, "preparing to unwind task: 0x%" PRIxPTR, this); // run_on_resume(rust_unwind_glue); } @@ -442,12 +445,15 @@ rust_task::wakeup(rust_cond *from) { if(_on_wakeup) { _on_wakeup->on_wakeup(); } + + sched->lock.signal(); } void rust_task::die() { scoped_lock with(lock); transition(&sched->running_tasks, &sched->dead_tasks); + sched->lock.signal(); } void |
