diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-08 14:05:23 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-08 14:05:42 -0800 |
| commit | 2f8b69534435d8dc459e5731d8fb41b22725b37f (patch) | |
| tree | 6c406ba920a6dac4fd1d6eb82cba8c2884c1aa82 | |
| parent | 0f1af17a6069160f12085841796198e67b6c710f (diff) | |
| download | rust-2f8b69534435d8dc459e5731d8fb41b22725b37f.tar.gz rust-2f8b69534435d8dc459e5731d8fb41b22725b37f.zip | |
start_task can run on the C stack
| -rw-r--r-- | src/lib/task.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/task.rs b/src/lib/task.rs index 304cf59f81d..b8983e97c8b 100644 --- a/src/lib/task.rs +++ b/src/lib/task.rs @@ -54,7 +54,6 @@ native "cdecl" mod rustrt { // these must run on the Rust stack so that they can swap stacks etc: fn task_sleep(time_in_us: uint); fn task_yield(); - fn start_task(id: task, closure: *u8); } native "c-stack-cdecl" mod rustrt2 = "rustrt" { @@ -70,6 +69,9 @@ native "c-stack-cdecl" mod rustrt2 = "rustrt" { fn get_task_pointer(id: task_id) -> *rust_task; fn migrate_alloc(alloc: *u8, target: task_id); + + fn start_task(id: task, closure: *u8); + } /* Section: Types */ @@ -322,7 +324,7 @@ fn unsafe_spawn_inner(-thunk: fn@(), // give the thunk environment's allocation to the new task rustrt2::migrate_alloc(cast(raw_thunk.env), id); - rustrt::start_task(id, cast(thunkfn)); + rustrt2::start_task(id, cast(thunkfn)); // don't cleanup the thunk in this task unsafe::leak(thunk); ret id; |
