Add an unsupervise builtin and function to std::task
Calling task::unsupervise de-parents the current task, with the result that failures do not propogate up the task tree.
This commit is contained in:
parent
4738cf83b0
commit
01a52d728c
@ -2,6 +2,7 @@ native "rust" mod rustrt {
|
||||
fn task_sleep(uint time_in_us);
|
||||
fn task_yield();
|
||||
fn task_join(task t);
|
||||
fn task_unsupervise();
|
||||
fn pin_task();
|
||||
fn unpin_task();
|
||||
}
|
||||
@ -23,6 +24,10 @@ fn join(task t) {
|
||||
ret rustrt::task_join(t);
|
||||
}
|
||||
|
||||
fn unsupervise() {
|
||||
ret rustrt::task_unsupervise();
|
||||
}
|
||||
|
||||
fn pin() {
|
||||
rustrt::pin_task();
|
||||
}
|
||||
|
@ -425,6 +425,11 @@ task_join(rust_task *task, rust_task *join_task) {
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
task_unsupervise(rust_task *task) {
|
||||
task->unsupervise();
|
||||
}
|
||||
|
||||
/* Debug builtins for std.dbg. */
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user