Modify task::join to indicate how the task terminated
This involves sticking yet another field into the task structure
This commit is contained in:
parent
d9cc4cb81b
commit
ced8393f20
6 changed files with 43 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
native "rust" mod rustrt {
|
||||
fn task_sleep(uint time_in_us);
|
||||
fn task_yield();
|
||||
fn task_join(task t);
|
||||
fn task_join(task t) -> int;
|
||||
fn task_unsupervise();
|
||||
fn pin_task();
|
||||
fn unpin_task();
|
||||
|
|
@ -20,8 +20,16 @@ fn yield() {
|
|||
ret rustrt::task_yield();
|
||||
}
|
||||
|
||||
fn join(task t) {
|
||||
ret rustrt::task_join(t);
|
||||
tag task_result {
|
||||
tr_success;
|
||||
tr_failure;
|
||||
}
|
||||
|
||||
fn join(task t) -> task_result {
|
||||
alt (rustrt::task_join(t)) {
|
||||
0 { tr_success }
|
||||
_ { tr_failure }
|
||||
}
|
||||
}
|
||||
|
||||
fn unsupervise() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue