aboutsummaryrefslogtreecommitdiff
path: root/src/lib/_task.rs
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-11 21:23:34 -0700
committerMichael Bebenita <[email protected]>2010-08-11 21:24:04 -0700
commit988695a96cee1eb825435260a1874b8daa0e590a (patch)
treeee92e117a653c8c6fad100e7416afe5468073ff3 /src/lib/_task.rs
parentSome ELF correctness issues, but apparently none enough to placate gdb. (diff)
downloadrust-988695a96cee1eb825435260a1874b8daa0e590a.tar.xz
rust-988695a96cee1eb825435260a1874b8daa0e590a.zip
Added support for task sleeping in the scheduler.
Diffstat (limited to 'src/lib/_task.rs')
-rw-r--r--src/lib/_task.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/_task.rs b/src/lib/_task.rs
new file mode 100644
index 00000000..a12c2f27
--- /dev/null
+++ b/src/lib/_task.rs
@@ -0,0 +1,12 @@
+native "rust" mod rustrt {
+ fn task_sleep(uint time_in_us);
+}
+
+/**
+ * Hints the scheduler to yield this task for a specified ammount of time.
+ *
+ * arg: time_in_us maximum number of microseconds to yield control for
+ */
+fn sleep(uint time_in_us) {
+ ret rustrt.task_sleep(time_in_us);
+} \ No newline at end of file