Skip to content

Commit 2f8b695

Browse files
committed
start_task can run on the C stack
1 parent 0f1af17 commit 2f8b695

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/task.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ native "cdecl" mod rustrt {
5454
// these must run on the Rust stack so that they can swap stacks etc:
5555
fn task_sleep(time_in_us: uint);
5656
fn task_yield();
57-
fn start_task(id: task, closure: *u8);
5857
}
5958

6059
native "c-stack-cdecl" mod rustrt2 = "rustrt" {
@@ -70,6 +69,9 @@ native "c-stack-cdecl" mod rustrt2 = "rustrt" {
7069
fn get_task_pointer(id: task_id) -> *rust_task;
7170

7271
fn migrate_alloc(alloc: *u8, target: task_id);
72+
73+
fn start_task(id: task, closure: *u8);
74+
7375
}
7476

7577
/* Section: Types */
@@ -322,7 +324,7 @@ fn unsafe_spawn_inner(-thunk: fn@(),
322324

323325
// give the thunk environment's allocation to the new task
324326
rustrt2::migrate_alloc(cast(raw_thunk.env), id);
325-
rustrt::start_task(id, cast(thunkfn));
327+
rustrt2::start_task(id, cast(thunkfn));
326328
// don't cleanup the thunk in this task
327329
unsafe::leak(thunk);
328330
ret id;

0 commit comments

Comments
 (0)