Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/backoff.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// Vendored and simplified from crossbeam-utils
use core::cell::Cell;
use core::sync::atomic;

const SPIN_LIMIT: u32 = 6;

Expand Down Expand Up @@ -31,9 +30,7 @@ impl Backoff {
#[inline]
pub fn spin(&self) {
for _ in 0..1 << self.step.get().min(SPIN_LIMIT) {
// `hint::spin_loop` requires Rust 1.49.
#[allow(deprecated)]
atomic::spin_loop_hint();
core::hint::spin_loop();
}

if self.step.get() <= SPIN_LIMIT {
Expand Down
8 changes: 2 additions & 6 deletions src/concurrency_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ impl ConcurrencyControl {
if self.active.fetch_or(RW_REQUIRED_BIT, SeqCst) < RW_REQUIRED_BIT {
// we are the first to set this bit
while self.active.load(Acquire) != RW_REQUIRED_BIT {
// `hint::spin_loop` requires Rust 1.49.
#[allow(deprecated)]
std::sync::atomic::spin_loop_hint()
std::hint::spin_loop()
}
self.upgrade_complete.store(true, Release);
}
Expand Down Expand Up @@ -99,9 +97,7 @@ impl ConcurrencyControl {
});
self.enable();
while !self.upgrade_complete.load(Acquire) {
// `hint::spin_loop` requires Rust 1.49.
#[allow(deprecated)]
std::sync::atomic::spin_loop_hint()
std::hint::spin_loop()
}
Protector::Write(self.rw.write())
}
Expand Down