@@ -50,12 +50,12 @@ export spawn;
50
50
export spawn_notify;
51
51
export spawn_joinable;
52
52
53
- native "rust-intrinsic" mod rustrt {
53
+ native "rust-intrinsic" mod rusti {
54
54
// these must run on the Rust stack so that they can swap stacks etc:
55
55
fn task_sleep ( time_in_us : uint ) ;
56
56
}
57
57
58
- native "c-stack-cdecl" mod rustrt2 = "rustrt" {
58
+ native "c-stack-cdecl" mod rustrt = "rustrt" {
59
59
// these can run on the C stack:
60
60
fn pin_task ( ) ;
61
61
fn unpin_task ( ) ;
@@ -81,7 +81,7 @@ type rust_task =
81
81
mutable notify_chan: comm:: chan<task_notification>,
82
82
mutable stack_ptr: * u8} ;
83
83
84
- resource rust_task_ptr ( task: * rust_task) { rustrt2 :: drop_task ( task) ; }
84
+ resource rust_task_ptr ( task: * rust_task) { rustrt :: drop_task ( task) ; }
85
85
86
86
type task_id = int ;
87
87
@@ -128,7 +128,7 @@ Type: get_task
128
128
129
129
Retreives a handle to the currently executing task
130
130
*/
131
- fn get_task ( ) -> task { rustrt2 :: get_task_id ( ) }
131
+ fn get_task ( ) -> task { rustrt :: get_task_id ( ) }
132
132
133
133
/*
134
134
Function: sleep
@@ -139,7 +139,7 @@ Parameters:
139
139
140
140
time_in_us - maximum number of microseconds to yield control for
141
141
*/
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) ; }
143
143
144
144
/*
145
145
Function: yield
@@ -188,14 +188,14 @@ Function: pin
188
188
189
189
Pins the current task and future child tasks to a single scheduler thread
190
190
*/
191
- fn pin ( ) { rustrt2 :: pin_task ( ) ; }
191
+ fn pin ( ) { rustrt :: pin_task ( ) ; }
192
192
193
193
/*
194
194
Function: unpin
195
195
196
196
Unpin the current task and future child tasks
197
197
*/
198
- fn unpin ( ) { rustrt2 :: unpin_task ( ) ; }
198
+ fn unpin ( ) { rustrt :: unpin_task ( ) ; }
199
199
200
200
/*
201
201
Function: set_min_stack
@@ -204,7 +204,7 @@ Set the minimum stack size (in bytes) for tasks spawned in the future.
204
204
205
205
This function has global effect and should probably not be used.
206
206
*/
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) ; }
208
208
209
209
/*
210
210
Function: spawn
@@ -293,12 +293,12 @@ fn spawn_inner<uniq T>(-data: T, f: fn(T),
293
293
fn unsafe_spawn_inner( -thunk : fn @( ) ,
294
294
notify : option < comm:: chan < task_notification > > ) ->
295
295
task unsafe {
296
- let id = rustrt2 :: new_task ( ) ;
296
+ let id = rustrt :: new_task ( ) ;
297
297
298
298
let raw_thunk: { code : u32 , env : u32 } = cast ( thunk) ;
299
299
300
300
// 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 ) ) ;
302
302
303
303
assert ( ptr:: null ( ) != ( * * task_ptr) . stack_ptr ) ;
304
304
@@ -322,8 +322,8 @@ fn unsafe_spawn_inner(-thunk: fn@(),
322
322
}
323
323
324
324
// 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 ) ) ;
327
327
// don't cleanup the thunk in this task
328
328
unsafe :: leak ( thunk ) ;
329
329
ret id;
0 commit comments