Skip to content

Commit d536bc2

Browse files
committed
Clean up std::task
1 parent 061d2c2 commit d536bc2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/lib/task.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ export spawn;
5050
export spawn_notify;
5151
export spawn_joinable;
5252

53-
native "rust-intrinsic" mod rustrt {
53+
native "rust-intrinsic" mod rusti {
5454
// these must run on the Rust stack so that they can swap stacks etc:
5555
fn task_sleep(time_in_us: uint);
5656
}
5757

58-
native "c-stack-cdecl" mod rustrt2 = "rustrt" {
58+
native "c-stack-cdecl" mod rustrt = "rustrt" {
5959
// these can run on the C stack:
6060
fn pin_task();
6161
fn unpin_task();
@@ -81,7 +81,7 @@ type rust_task =
8181
mutable notify_chan: comm::chan<task_notification>,
8282
mutable stack_ptr: *u8};
8383

84-
resource rust_task_ptr(task: *rust_task) { rustrt2::drop_task(task); }
84+
resource rust_task_ptr(task: *rust_task) { rustrt::drop_task(task); }
8585

8686
type task_id = int;
8787

@@ -128,7 +128,7 @@ Type: get_task
128128
129129
Retreives a handle to the currently executing task
130130
*/
131-
fn get_task() -> task { rustrt2::get_task_id() }
131+
fn get_task() -> task { rustrt::get_task_id() }
132132

133133
/*
134134
Function: sleep
@@ -139,7 +139,7 @@ Parameters:
139139
140140
time_in_us - maximum number of microseconds to yield control for
141141
*/
142-
fn sleep(time_in_us: uint) { ret rustrt::task_sleep(time_in_us); }
142+
fn sleep(time_in_us: uint) { ret rusti::task_sleep(time_in_us); }
143143

144144
/*
145145
Function: yield
@@ -188,14 +188,14 @@ Function: pin
188188
189189
Pins the current task and future child tasks to a single scheduler thread
190190
*/
191-
fn pin() { rustrt2::pin_task(); }
191+
fn pin() { rustrt::pin_task(); }
192192

193193
/*
194194
Function: unpin
195195
196196
Unpin the current task and future child tasks
197197
*/
198-
fn unpin() { rustrt2::unpin_task(); }
198+
fn unpin() { rustrt::unpin_task(); }
199199

200200
/*
201201
Function: set_min_stack
@@ -204,7 +204,7 @@ Set the minimum stack size (in bytes) for tasks spawned in the future.
204204
205205
This function has global effect and should probably not be used.
206206
*/
207-
fn set_min_stack(stack_size: uint) { rustrt2::set_min_stack(stack_size); }
207+
fn set_min_stack(stack_size: uint) { rustrt::set_min_stack(stack_size); }
208208

209209
/*
210210
Function: spawn
@@ -293,12 +293,12 @@ fn spawn_inner<uniq T>(-data: T, f: fn(T),
293293
fn unsafe_spawn_inner(-thunk: fn@(),
294294
notify: option<comm::chan<task_notification>>) ->
295295
task unsafe {
296-
let id = rustrt2::new_task();
296+
let id = rustrt::new_task();
297297

298298
let raw_thunk: {code: u32, env: u32} = cast(thunk);
299299

300300
// set up the task pointer
301-
let task_ptr <- rust_task_ptr(rustrt2::get_task_pointer(id));
301+
let task_ptr <- rust_task_ptr(rustrt::get_task_pointer(id));
302302

303303
assert (ptr::null() != (**task_ptr).stack_ptr);
304304

@@ -322,8 +322,8 @@ fn unsafe_spawn_inner(-thunk: fn@(),
322322
}
323323

324324
// give the thunk environment's allocation to the new task
325-
rustrt2::migrate_alloc(cast(raw_thunk.env), id);
326-
rustrt2::start_task(id, cast(thunkfn));
325+
rustrt::migrate_alloc(cast(raw_thunk.env), id);
326+
rustrt::start_task(id, cast(thunkfn));
327327
// don't cleanup the thunk in this task
328328
unsafe::leak(thunk);
329329
ret id;

0 commit comments

Comments
 (0)