diff options
| author | Kevin Ballard <kevin@sb.org> | 2013-08-16 12:49:40 -0700 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2013-08-16 13:26:50 -0700 |
| commit | 418e1ebae6ed543b1a78c3e987d42bf0bf25f310 (patch) | |
| tree | 6fe66cd490adb82b0e712f4e34b6fa331ad4ba18 /src/libstd/rt | |
| parent | 680eb71564ebba5e76ce1e1a8287b30042332cc5 (diff) | |
| download | rust-418e1ebae6ed543b1a78c3e987d42bf0bf25f310.tar.gz rust-418e1ebae6ed543b1a78c3e987d42bf0bf25f310.zip | |
Reserve 'yield' keyword
Rename task::yield() to task::deschedule(). Fixes #8494.
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/kill.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index 83bf34941dc..1608d8cbc2c 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -141,7 +141,7 @@ pub struct Death { on_exit: Option<~fn(bool)>, // nesting level counter for task::unkillable calls (0 == killable). unkillable: int, - // nesting level counter for unstable::atomically calls (0 == can yield). + // nesting level counter for unstable::atomically calls (0 == can deschedule). wont_sleep: int, // A "spare" handle to the kill flag inside the kill handle. Used during // blocking/waking as an optimization to avoid two xadds on the refcount. @@ -572,16 +572,16 @@ impl Death { } /// Enter a possibly-nested "atomic" section of code. Just for assertions. - /// All calls must be paired with a subsequent call to allow_yield. + /// All calls must be paired with a subsequent call to allow_deschedule. #[inline] - pub fn inhibit_yield(&mut self) { + pub fn inhibit_deschedule(&mut self) { self.wont_sleep += 1; } /// Exit a possibly-nested "atomic" section of code. Just for assertions. - /// All calls must be paired with a preceding call to inhibit_yield. + /// All calls must be paired with a preceding call to inhibit_deschedule. #[inline] - pub fn allow_yield(&mut self) { + pub fn allow_deschedule(&mut self) { rtassert!(self.wont_sleep != 0); self.wont_sleep -= 1; } |
