Fix compilation on Rust 1.48

This commit is contained in:
Roderick van Domburg 2021-06-22 21:54:50 +02:00
parent d3074f597a
commit 4fe1183a80
No known key found for this signature in database
GPG key ID: 7076AA781B43EFE6

View file

@ -1,7 +1,6 @@
use hyper::{Body, Request}; use hyper::{Body, Request};
use serde::Deserialize; use serde::Deserialize;
use std::error::Error; use std::error::Error;
use std::hint;
use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};
pub type SocketAddress = (String, u16); pub type SocketAddress = (String, u16);
@ -115,7 +114,8 @@ impl ApResolver {
// parallel and they will all call this function, while resolving is still in progress. // parallel and they will all call this function, while resolving is still in progress.
self.lock(|inner| { self.lock(|inner| {
while inner.spinlock.load(Ordering::SeqCst) != 0 { while inner.spinlock.load(Ordering::SeqCst) != 0 {
hint::spin_loop() #[allow(deprecated)]
std::sync::atomic::spin_loop_hint()
} }
inner.spinlock.store(1, Ordering::SeqCst); inner.spinlock.store(1, Ordering::SeqCst);
}); });