Skip to content

Commit 82bbd9c

Browse files
committed
Allow use of spin_loop_hint
It's being deprecated/moved elsewhere. But we want to support old compilers too.
1 parent 963de2c commit 82bbd9c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

signal-hook-registry/src/half_lock.rs

+2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ impl<T> HalfLock<T> {
181181
if iter % YIELD_EVERY == 0 {
182182
thread::yield_now();
183183
} else {
184+
// Replaced by hint::spin_loop, but we want to support older compiler
185+
#[allow(deprecated)]
184186
atomic::spin_loop_hint();
185187
}
186188
}

src/flag.rs

+2
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ mod tests {
247247
fn wait_flag(flag: &AtomicBool) -> bool {
248248
let start = Instant::now();
249249
while !flag.load(Ordering::Relaxed) {
250+
// Replaced by hint::spin_loop, but we want to support older compiler
251+
#[allow(deprecated)]
250252
atomic::spin_loop_hint();
251253
if Instant::now() - start > Duration::from_secs(1) {
252254
// We reached a timeout and nothing happened yet.

0 commit comments

Comments
 (0)