diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-18 13:33:08 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-18 13:38:18 -0800 |
| commit | 3cfcdb4bb279bab6f58b147486f5e2a54411b316 (patch) | |
| tree | 408074287154f4dc346a67ed9cd65659e8fcf7c3 /src/rt/rust_task.cpp | |
| parent | 57b43b53f9c673545b25338eefa7f3c620d85aa4 (diff) | |
| download | rust-3cfcdb4bb279bab6f58b147486f5e2a54411b316.tar.gz rust-3cfcdb4bb279bab6f58b147486f5e2a54411b316.zip | |
rt: Replace two uses of yield with ctx->swap
These uses aren't really doing a full yield. They are just giving up control to the scheduler and will never return.
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index c4ca82440bd..a7d92b96e3c 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -213,8 +213,8 @@ void task_start_wrapper(spawn_args *a) } else { task->lock.lock(); task->lock.unlock(); - task->yield(1); } + task->ctx.next->swap(task->ctx); } void @@ -274,7 +274,7 @@ rust_task::yield(size_t time_in_us) { LOG(this, task, "task %s @0x%" PRIxPTR " yielding for %d us", name, this, time_in_us); - if (killed && !dead()) { + if (killed) { // Receive may have blocked before yielding unblock(); fail(); @@ -333,7 +333,6 @@ void rust_task::conclude_failure() { fail_parent(); failed = true; - yield(4); } void |
