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_task.h | |
| 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_task.h')
| -rw-r--r-- | src/rt/rust_task.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 27495e2c..b66ee5a1 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -29,6 +29,9 @@ rust_task : public maybe_proxy<rust_task>, size_t gc_alloc_thresh; size_t gc_alloc_accum; + // Keeps track of the last time this task yielded. + timer yield_timer; + // Rendezvous pointer for receiving data when blocked on a port. If we're // trying to read data and no data is available on any incoming channel, // we block on the port, and yield control to the scheduler. Since, we @@ -88,6 +91,9 @@ rust_task : public maybe_proxy<rust_task>, // Save callee-saved registers and return to the main loop. void yield(size_t nargs); + // Yields for a specified duration of time. + void yield(size_t nargs, size_t time_in_ms); + // Fail this task (assuming caller-on-stack is different task). void kill(); |