diff options
| author | bors <bors@rust-lang.org> | 2016-08-30 16:28:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-30 16:28:32 -0700 |
| commit | eac41469d778d18ae7bf38fa917ed0fe122f944b (patch) | |
| tree | 566d38ce5971d64222c2d3cd00499e2d666e66a8 /src/libstd/sys/windows | |
| parent | 4473130f4e0a20278225251ea6a0400258b03180 (diff) | |
| parent | 59e5e0b2db2ab66f138044bde80c44c7f9391a00 (diff) | |
| download | rust-eac41469d778d18ae7bf38fa917ed0fe122f944b.tar.gz rust-eac41469d778d18ae7bf38fa917ed0fe122f944b.zip | |
Auto merge of #35048 - tmiasko:monotonic-wait-timeout, r=alexcrichton
Use monotonic time in condition variables. Configure condition variables to use monotonic time using pthread_condattr_setclock on systems where this is possible. This fixes the issue when thread waiting on condition variable is woken up too late when system time is moved backwards.
Diffstat (limited to 'src/libstd/sys/windows')
| -rw-r--r-- | src/libstd/sys/windows/condvar.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/sys/windows/condvar.rs b/src/libstd/sys/windows/condvar.rs index 8075374d42b..d708b327c55 100644 --- a/src/libstd/sys/windows/condvar.rs +++ b/src/libstd/sys/windows/condvar.rs @@ -25,6 +25,9 @@ impl Condvar { } #[inline] + pub unsafe fn init(&mut self) {} + + #[inline] pub unsafe fn wait(&self, mutex: &Mutex) { let r = c::SleepConditionVariableSRW(self.inner.get(), mutex::raw(mutex), |
