Skip to content

Commit 9bbf0d8

Browse files
authored
Merge pull request #18 from taiki-e/compare_and_swap
Replace deprecated compare_and_swap with compare_exchange
2 parents 337af81 + c4d0198 commit 9bbf0d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,10 @@ impl State {
497497
/// Notifies a sleeping ticker.
498498
#[inline]
499499
fn notify(&self) {
500-
if !self
500+
if self
501501
.notified
502-
.compare_and_swap(false, true, Ordering::SeqCst)
502+
.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
503+
.is_ok()
503504
{
504505
let waker = self.sleepers.lock().unwrap().notify();
505506
if let Some(w) = waker {

0 commit comments

Comments
 (0)