diff options
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/condvar.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 1f480f6d4a9..4c946e613ea 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -80,10 +80,14 @@ impl Condvar { /// notified. #[stable(feature = "rust1", since = "1.0.0")] pub fn new() -> Condvar { - Condvar { + let mut c = Condvar { inner: box sys::Condvar::new(), mutex: AtomicUsize::new(0), + }; + unsafe { + c.inner.init(); } + c } /// Blocks the current thread until this condition variable receives a @@ -138,6 +142,10 @@ impl Condvar { /// differences that may not cause the maximum amount of time /// waited to be precisely `ms`. /// + /// Note that the best effort is made to ensure that the time waited is + /// measured with a monotonic clock, and not affected by the changes made to + /// the system time. + /// /// The returned boolean is `false` only if the timeout is known /// to have elapsed. /// @@ -162,6 +170,10 @@ impl Condvar { /// preemption or platform differences that may not cause the maximum /// amount of time waited to be precisely `dur`. /// + /// Note that the best effort is made to ensure that the time waited is + /// measured with a monotonic clock, and not affected by the changes made to + /// the system time. + /// /// The returned `WaitTimeoutResult` value indicates if the timeout is /// known to have elapsed. /// |
