diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-11-24 11:16:40 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-05 09:12:25 -0800 |
| commit | c3adbd34c4e637d20a184eb03f09b30c69de8b6e (patch) | |
| tree | 7be3d3a9b5bf062fcffc8aa0b9e0de8267ab41c9 /src/libstd/sync | |
| parent | 71d4e77db8ad4b6d821da7e5d5300134ac95974e (diff) | |
| download | rust-c3adbd34c4e637d20a184eb03f09b30c69de8b6e.tar.gz rust-c3adbd34c4e637d20a184eb03f09b30c69de8b6e.zip | |
Fall out of the std::sync rewrite
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/condvar.rs | 15 | ||||
| -rw-r--r-- | src/libstd/sync/mutex.rs | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 581b6b4e412..0fdd57b2792 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -143,8 +143,14 @@ impl Condvar { /// /// Like `wait`, the lock specified will be re-acquired when this function /// returns, regardless of whether the timeout elapsed or not. - pub fn wait_timeout<T: AsMutexGuard>(&self, mutex_guard: &T, - dur: Duration) -> bool { + // Note that this method is *not* public, and this is quite intentional + // because we're not quite sure about the semantics of relative vs absolute + // durations or how the timing guarantees play into what the system APIs + // provide. There are also additional concerns about the unix-specific + // implementation which may need to be addressed. + #[allow(dead_code)] + fn wait_timeout<T: AsMutexGuard>(&self, mutex_guard: &T, + dur: Duration) -> bool { unsafe { let me: &'static Condvar = &*(self as *const _); me.inner.wait_timeout(mutex_guard, dur) @@ -195,8 +201,9 @@ impl StaticCondvar { /// specified duration. /// /// See `Condvar::wait_timeout`. - pub fn wait_timeout<T: AsMutexGuard>(&'static self, mutex_guard: &T, - dur: Duration) -> bool { + #[allow(dead_code)] // may want to stabilize this later, see wait_timeout above + fn wait_timeout<T: AsMutexGuard>(&'static self, mutex_guard: &T, + dur: Duration) -> bool { unsafe { let lock = mutex_guard.as_mutex_guard(); let sys = mutex::guard_lock(lock); diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 3d17f2bc64b..4e07d54c57e 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -45,7 +45,7 @@ use sys_common::mutex as sys; /// let data = Arc::new(Mutex::new(0)); /// /// let (tx, rx) = channel(); -/// for _ in range(0, 10) { +/// for _ in range(0u, 10) { /// let (data, tx) = (data.clone(), tx.clone()); /// spawn(proc() { /// // The shared static can only be accessed once the lock is held. |
