diff options
| author | Vitali Lovich <vlovich@google.com> | 2018-02-13 11:32:04 -0800 |
|---|---|---|
| committer | Vitali Lovich <vlovich@google.com> | 2018-02-13 11:32:04 -0800 |
| commit | 6fe2d1d765810c05ce2aa2184baa9f4aabf1a151 (patch) | |
| tree | 544e36a996f9f1e4d35da3d2ecdd87bdfd8920de /src/libstd/sync | |
| parent | 97df227d19791b0e9d199be28851fb924c3c1e21 (diff) | |
| download | rust-6fe2d1d765810c05ce2aa2184baa9f4aabf1a151.tar.gz rust-6fe2d1d765810c05ce2aa2184baa9f4aabf1a151.zip | |
Misc fixes
Switch feature guards to unstable Add missing semicolon Remove mut that's no longer necessary
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/condvar.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 65235aa62a1..98fadbd3543 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -263,7 +263,7 @@ impl Condvar { /// // As long as the value inside the `Mutex` is false, we wait. /// cvar.wait_until(lock.lock().unwrap(), |started| { started }); /// ``` - #[stable(feature = "wait_until", since = "1.24")] + #[unstable(feature = "wait_until", issue = "47960")] pub fn wait_until<'a, T, F>(&self, mut guard: MutexGuard<'a, T>, mut condition: F) -> LockResult<MutexGuard<'a, T>> @@ -470,9 +470,9 @@ impl Condvar { /// } /// // access the locked mutex via result.0 /// ``` - #[stable(feature = "wait_timeout_until", since = "1.24")] + #[unstable(feature = "wait_timeout_until", issue = "47960")] pub fn wait_timeout_until<'a, T, F>(&self, mut guard: MutexGuard<'a, T>, - mut dur: Duration, mut condition: F) + dur: Duration, mut condition: F) -> LockResult<(MutexGuard<'a, T>, WaitTimeoutResult)> where F: FnMut(&mut T) -> bool { let start = Instant::now(); @@ -483,7 +483,7 @@ impl Condvar { let timeout = match dur.checked_sub(start.elapsed()) { Some(timeout) => timeout, None => return Ok((guard, WaitTimeoutResult(true))), - } + }; guard = self.wait_timeout(guard, timeout)?.0; } } |
