Rewrite spawn yet again

The motivation here is that the bottom of each stack needs to contain a C++
try/catch block so that we can unwind. This is already the case for main, but
not spawned tasks.

Issue #236
This commit is contained in:
Brian Anderson
2011-09-06 14:03:20 -07:00
parent 1bd627039e
commit 25ae3d655c
8 changed files with 87 additions and 94 deletions

View File

@@ -48,10 +48,10 @@ void
rust_scheduler::activate(rust_task *task) {
context ctx;
task->user.ctx.next = &ctx;
task->ctx.next = &ctx;
DLOG(this, task, "descheduling...");
lock.unlock();
task->user.ctx.swap(ctx);
task->ctx.swap(ctx);
lock.lock();
DLOG(this, task, "task has returned");
}