about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-11-18 13:33:08 -0800
committerBrian Anderson <banderson@mozilla.com>2011-11-18 13:38:18 -0800
commit3cfcdb4bb279bab6f58b147486f5e2a54411b316 (patch)
tree408074287154f4dc346a67ed9cd65659e8fcf7c3 /src/rt/rust_task.cpp
parent57b43b53f9c673545b25338eefa7f3c620d85aa4 (diff)
downloadrust-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.cpp5
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