diff options
| author | Pslydhh <luouyuyou@gmail.com> | 2018-06-02 15:59:54 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-02 15:59:54 +0800 |
| commit | b352d2d167f1de4ed8a6da3405dc90fe9d646204 (patch) | |
| tree | 2f5aba1d6961552c33892734327af5b781ece222 /src/libstd/thread | |
| parent | 151e41ff0c2769b5bc9f0d37ae37136fb4fcb7e0 (diff) | |
| download | rust-b352d2d167f1de4ed8a6da3405dc90fe9d646204.tar.gz rust-b352d2d167f1de4ed8a6da3405dc90fe9d646204.zip | |
removes tabs
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index d76107e9909..e6d052a458f 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -797,10 +797,9 @@ pub fn park() { match thread.inner.state.compare_exchange(EMPTY, PARKED, SeqCst, SeqCst) { Ok(_) => {} Err(NOTIFIED) => { - // should consume this notification, so prohibit spurious wakeups in next park... - thread.inner.state.store(EMPTY, SeqCst); - return; - }, // notified after we locked + thread.inner.state.store(EMPTY, SeqCst); + return; + } // should consume this notification, so prohibit spurious wakeups in next park. Err(_) => panic!("inconsistent park state"), } loop { @@ -887,10 +886,9 @@ pub fn park_timeout(dur: Duration) { match thread.inner.state.compare_exchange(EMPTY, PARKED, SeqCst, SeqCst) { Ok(_) => {} Err(NOTIFIED) => { - // should consume this notification, so prohibit spurious wakeups in next park... - thread.inner.state.store(EMPTY, SeqCst); - return; - }, // notified after we locked + thread.inner.state.store(EMPTY, SeqCst); + return; + } // should consume this notification, so prohibit spurious wakeups in next park. Err(_) => panic!("inconsistent park_timeout state"), } |
