diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-08 15:38:56 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-08 15:58:08 -0800 |
| commit | 061d2c2f7791f18538c42d043fb320f0316a0ed6 (patch) | |
| tree | 281c4cc15c726197c74fb2152d90045243203115 /src/rt/rust_builtin.cpp | |
| parent | 68f82de8178ca5f7ed7a3803fdc41f84fc97664b (diff) | |
| download | rust-061d2c2f7791f18538c42d043fb320f0316a0ed6.tar.gz rust-061d2c2f7791f18538c42d043fb320f0316a0ed6.zip | |
Make task_sleep an intrinsic.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index dd1e6a2c15c..53650beea38 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -165,12 +165,6 @@ rand_free(randctx *rctx) { task->free(rctx); } -extern "C" CDECL void -task_sleep(size_t time_in_us) { - rust_task *task = rust_scheduler::get_task(); - task->yield(time_in_us); -} - /* Debug builtins for std::dbg. */ static void @@ -544,6 +538,16 @@ chan_id_send(type_desc *t, rust_task_id target_task_id, } } +// This is called by an intrinsic on the Rust stack. +// Do not call on the C stack. +extern "C" CDECL void +rust_task_sleep(size_t time_in_us) { + rust_task *task = rust_scheduler::get_task(); + task->yield(time_in_us); +} + +// This is called by an intrinsic on the Rust stack. +// Do not call on the C stack. extern "C" CDECL void port_recv(uintptr_t *dptr, rust_port *port) { rust_task *task = rust_scheduler::get_task(); |
