diff --git a/src/lib/task.rs b/src/lib/task.rs index f15bdade360..90885f2ab46 100644 --- a/src/lib/task.rs +++ b/src/lib/task.rs @@ -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(); } diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 1ed2c4ec36d..e8900dd730a 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -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