rt: Expose the C stack inside the Rust scheduler so that C calls can switch to it

This commit is contained in:
Patrick Walton
2011-09-27 19:19:19 -07:00
parent dbf472b0df
commit e8757ea01f
2 changed files with 5 additions and 4 deletions

View File

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