Skip to content

Commit d4e7405

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

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
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::{
7+
hint,
8+
sync::atomic::{AtomicBool, Ordering},
9+
};
710
use lock_api::{GuardSend, RawMutex};
811

912
/// Provides mutual exclusion based on spinning on an `AtomicBool`.
@@ -51,7 +54,7 @@ unsafe impl RawMutex for RawSpinlock {
5154
// Code from https://github.com/mvdnes/spin-rs/commit/d3e60d19adbde8c8e9d3199c7c51e51ee5a20bf6
5255
while self.is_locked() {
5356
// Tell the CPU that we're inside a busy-wait loop
54-
spin_loop_hint();
57+
hint::spin_loop();
5558
}
5659
}
5760
}

0 commit comments

Comments
 (0)