Skip to content

Commit e9b7d80

Browse files
committed
---
yaml --- r: 5973 b: refs/heads/master c: 00404eb h: refs/heads/master i: 5971: 7ff2c55 v: v3
1 parent 62cdc06 commit e9b7d80

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
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: 20e4f793e22e7078435259e8fe65ca60f92fec1c
2+
refs/heads/master: 00404ebe62734025b93bc6ec4e5e2a9640032984

trunk/src/lib/comm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,5 @@ Constructs a channel.
132132
The channel is bound to the port used to construct it.
133133
*/
134134
fn chan<unique T>(p: port<T>) -> chan<T> {
135-
chan_t(task::get_task_id(), rustrt::get_port_id(***p))
135+
chan_t(task::get_task(), rustrt::get_port_id(***p))
136136
}

trunk/src/lib/task.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export set_min_stack;
2222
export task_result;
2323
export tr_success;
2424
export tr_failure;
25-
export get_task_id;
25+
export get_task;
2626
export spawn;
2727
export spawn_notify;
2828
export spawn_joinable;
@@ -31,7 +31,7 @@ native "cdecl" mod rustrt {
3131
// these must run on the Rust stack so that they can swap stacks etc:
3232
fn task_sleep(time_in_us: uint);
3333
fn task_yield();
34-
fn start_task(id: task_id, closure: *u8);
34+
fn start_task(id: task, closure: *u8);
3535
}
3636

3737
native "c-stack-cdecl" mod rustrt2 = "rustrt" {
@@ -43,7 +43,7 @@ native "c-stack-cdecl" mod rustrt2 = "rustrt" {
4343
fn set_min_stack(stack_size: uint);
4444

4545
fn new_task() -> task_id;
46-
fn drop_task(task: *rust_task);
46+
fn drop_task(task_id: *rust_task);
4747
fn get_task_pointer(id: task_id) -> *rust_task;
4848

4949
fn migrate_alloc(alloc: *u8, target: task_id);
@@ -57,11 +57,11 @@ type rust_task =
5757

5858
resource rust_task_ptr(task: *rust_task) { rustrt2::drop_task(task); }
5959

60-
type task = int;
61-
type task_id = task;
62-
type joinable_task = (task_id, comm::port<task_notification>);
60+
type task_id = int;
61+
type task = task_id;
62+
type joinable_task = (task, comm::port<task_notification>);
6363

64-
fn get_task_id() -> task_id { rustrt2::get_task_id() }
64+
fn get_task() -> task { rustrt2::get_task_id() }
6565

6666
/**
6767
* Hints the scheduler to yield this task for a specified ammount of time.
@@ -76,7 +76,7 @@ tag task_result { tr_success; tr_failure; }
7676

7777
tag task_notification { exit(task, task_result); }
7878

79-
fn join(task_port: (task_id, comm::port<task_notification>)) -> task_result {
79+
fn join(task_port: joinable_task) -> task_result {
8080
let (id, port) = task_port;
8181
alt comm::recv::<task_notification>(port) {
8282
exit(_id, res) {
@@ -96,12 +96,12 @@ fn unpin() { rustrt2::unpin_task(); }
9696
fn set_min_stack(stack_size: uint) { rustrt2::set_min_stack(stack_size); }
9797

9898
fn spawn<unique T>(-data: T, f: fn(T)) -> task {
99-
spawn_inner2(data, f, none)
99+
spawn_inner(data, f, none)
100100
}
101101

102102
fn spawn_notify<unique T>(-data: T, f: fn(T),
103103
notify: comm::chan<task_notification>) -> task {
104-
spawn_inner2(data, f, some(notify))
104+
spawn_inner(data, f, some(notify))
105105
}
106106

107107
fn spawn_joinable<unique T>(-data: T, f: fn(T)) -> joinable_task {
@@ -120,9 +120,9 @@ fn spawn_joinable<unique T>(-data: T, f: fn(T)) -> joinable_task {
120120
//
121121
// After the transition this should all be rewritten.
122122

123-
fn spawn_inner2<unique T>(-data: T, f: fn(T),
123+
fn spawn_inner<unique T>(-data: T, f: fn(T),
124124
notify: option<comm::chan<task_notification>>)
125-
-> task_id {
125+
-> task {
126126

127127
fn wrapper<unique T>(-data: *u8, f: fn(T)) {
128128
let data: ~T = unsafe::reinterpret_cast(data);
@@ -140,7 +140,7 @@ fn spawn_inner2<unique T>(-data: T, f: fn(T),
140140
// It is a hack and needs to be rewritten.
141141
fn unsafe_spawn_inner(-thunk: fn@(),
142142
notify: option<comm::chan<task_notification>>) ->
143-
task_id unsafe {
143+
task unsafe {
144144
let id = rustrt2::new_task();
145145

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

0 commit comments

Comments
 (0)