diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/_task.rs | 12 | ||||
| -rw-r--r-- | src/lib/std.rc | 2 |
2 files changed, 14 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 diff --git a/src/lib/std.rc b/src/lib/std.rc index 8c956691..c2a2cf0c 100644 --- a/src/lib/std.rc +++ b/src/lib/std.rc @@ -15,6 +15,7 @@ mod _str; mod _io; mod sys; +mod _task; // Utility modules. @@ -25,6 +26,7 @@ mod util; auth _io = unsafe; auth _str = unsafe; auth _vec = unsafe; +auth _task = unsafe; auth _int.next_power_of_two = unsafe; auth map.mk_hashmap = unsafe; |