From 3cfcdb4bb279bab6f58b147486f5e2a54411b316 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 18 Nov 2011 13:33:08 -0800 Subject: 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. --- src/rt/rust_task.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/rt/rust_task.cpp') 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 -- cgit 1.4.1-3-g733a5