Skip to content

Commit 589160d

Browse files
committed
Fix spin_loop_hint warning on Rust 1.51
1 parent 458e4f4 commit 589160d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Fix `spin_loop_hint` warning on Rust 1.51
4+
35
# 0.2.2 – 2020-08-24
46

57
- Add owning_ref support ([#7](https://github.com/rust-osdev/spinning_top/pull/7))

src/spinlock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// and
44
// https://github.com/mvdnes/spin-rs/tree/7516c8037d3d15712ba4d8499ab075e97a19d778
55

6-
use core::sync::atomic::{spin_loop_hint, AtomicBool, Ordering};
6+
use core::{hint, sync::atomic::{AtomicBool, Ordering}};
77
use lock_api::{GuardSend, RawMutex};
88

99
/// Provides mutual exclusion based on spinning on an `AtomicBool`.
@@ -51,7 +51,7 @@ unsafe impl RawMutex for RawSpinlock {
5151
// Code from https://github.com/mvdnes/spin-rs/commit/d3e60d19adbde8c8e9d3199c7c51e51ee5a20bf6
5252
while self.is_locked() {
5353
// Tell the CPU that we're inside a busy-wait loop
54-
spin_loop_hint();
54+
hint::spin_loop();
5555
}
5656
}
5757
}

0 commit comments

Comments
 (0)