diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-01-16 19:58:42 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-03 12:05:16 -0800 |
| commit | b49771e392983b8aeed5bed9f510b72656544544 (patch) | |
| tree | c3ce5653472d6a775bbbaa6eca523af37a991cb8 /src/libstd/rt | |
| parent | 21e8466eca0536ab8ade7a74f7735fa6fda0142c (diff) | |
| download | rust-b49771e392983b8aeed5bed9f510b72656544544.tar.gz rust-b49771e392983b8aeed5bed9f510b72656544544.zip | |
std: Remove try_send_deferred plus all fallout
Now that extra::sync primitives are built on a proper mutex instead of a pthreads one, there's no longer any use for this function.
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/rt/task.rs | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 0e30f3e2efd..55425eb2e72 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -146,7 +146,7 @@ pub trait Runtime { fn maybe_yield(~self, cur_task: ~Task); fn deschedule(~self, times: uint, cur_task: ~Task, f: |BlockedTask| -> Result<(), BlockedTask>); - fn reawaken(~self, to_wake: ~Task, can_resched: bool); + fn reawaken(~self, to_wake: ~Task); // Miscellaneous calls which are very different depending on what context // you're in. @@ -154,6 +154,7 @@ pub trait Runtime { fn local_io<'a>(&'a mut self) -> Option<rtio::LocalIo<'a>>; /// The (low, high) edges of the current stack. fn stack_bounds(&self) -> (uint, uint); // (lo, hi) + fn can_block(&self) -> bool; // FIXME: This is a serious code smell and this should not exist at all. fn wrap(~self) -> ~Any; diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 515eb93001a..fbe82531f69 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -250,9 +250,9 @@ impl Task { /// Wakes up a previously blocked task, optionally specifiying whether the /// current task can accept a change in scheduling. This function can only /// be called on tasks that were previously blocked in `deschedule`. - pub fn reawaken(mut ~self, can_resched: bool) { + pub fn reawaken(mut ~self) { let ops = self.imp.take_unwrap(); - ops.reawaken(self, can_resched); + ops.reawaken(self); } /// Yields control of this task to another task. This function will @@ -283,6 +283,12 @@ impl Task { pub fn stack_bounds(&self) -> (uint, uint) { self.imp.get_ref().stack_bounds() } + + /// Returns whether it is legal for this task to block the OS thread that it + /// is running on. + pub fn can_block(&self) -> bool { + self.imp.get_ref().can_block() + } } impl Drop for Task { |
