diff options
| author | Michael Bebenita <[email protected]> | 2010-08-11 21:23:34 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-08-11 21:24:04 -0700 |
| commit | 988695a96cee1eb825435260a1874b8daa0e590a (patch) | |
| tree | ee92e117a653c8c6fad100e7416afe5468073ff3 /src/rt/rust_upcall.cpp | |
| parent | Some ELF correctness issues, but apparently none enough to placate gdb. (diff) | |
| download | rust-988695a96cee1eb825435260a1874b8daa0e590a.tar.xz rust-988695a96cee1eb825435260a1874b8daa0e590a.zip | |
Added support for task sleeping in the scheduler.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 01eaf744..7f9f0db1 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -183,6 +183,14 @@ extern "C" CDECL void upcall_yield(rust_task *task) { task->yield(1); } +extern "C" CDECL void upcall_sleep(rust_task *task, size_t time_in_us) { + LOG_UPCALL_ENTRY(task); + task->log(rust_log::UPCALL | rust_log::TASK, "elapsed %d", + task->yield_timer.get_elapsed_time()); + task->log(rust_log::UPCALL | rust_log::TASK, "sleep %d us", time_in_us); + task->yield(2, time_in_us); +} + extern "C" CDECL void upcall_join(rust_task *task, maybe_proxy<rust_task> *target) { LOG_UPCALL_ENTRY(task); |