Skip to content

Commit a2a1982

Browse files
nikomatsakisbrson
authored andcommitted
---
yaml --- r: 5946 b: refs/heads/master c: f8de679 h: refs/heads/master v: v3
1 parent dc588a7 commit a2a1982

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: e838edc0b331bd02b276ff17a1a6f1f98e68a7b3
2+
refs/heads/master: f8de679c1e7de9a099e0c98f6440e6e01978ce7f

trunk/src/lib/task.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,27 @@ export spawn;
2222
export spawn_notify;
2323
export spawn_joinable;
2424

25-
native "rust" mod rustrt { // C Stack?
26-
fn task_sleep(time_in_us: uint); // No
27-
fn task_yield(); // No
28-
fn start_task(id: task_id, closure: *u8); // No
29-
fn task_join(t: task_id) -> int; // Refactor
25+
native "cdecl" mod rustrt {
26+
// these must run on the Rust stack so that they can swap stacks etc:
27+
fn task_sleep(time_in_us: uint);
28+
fn task_yield();
29+
fn start_task(id: task_id, closure: *u8);
30+
fn task_join(t: task_id) -> int;
3031
}
3132

3233
native "c-stack-cdecl" mod rustrt2 = "rustrt" {
33-
fn pin_task(); // Yes
34-
fn unpin_task(); // Yes
35-
fn get_task_id() -> task_id; // Yes
34+
// these can run on the C stack:
35+
fn pin_task();
36+
fn unpin_task();
37+
fn get_task_id() -> task_id;
3638

37-
fn set_min_stack(stack_size: uint); // Yes
39+
fn set_min_stack(stack_size: uint);
3840

3941
fn new_task() -> task_id;
4042
fn drop_task(task: *rust_task);
4143
fn get_task_pointer(id: task_id) -> *rust_task;
4244

43-
fn migrate_alloc(alloc: *u8, target: task_id); // Yes
45+
fn migrate_alloc(alloc: *u8, target: task_id);
4446
}
4547

4648
type rust_task =

0 commit comments

Comments
 (0)