-use std::sync::{TryLockResult, LockResult, RwLock, RwLockReadGuard, RwLockWriteGuard};
+use std::sync::{LockResult, RwLock, RwLockReadGuard, RwLockWriteGuard};
use std::sync::atomic::{AtomicUsize, Ordering};
/// Rust libstd's RwLock does not provide any fairness guarantees (and, in fact, when used on
res
}
- pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<T>> {
- self.lock.try_write()
- }
-
pub fn read(&self) -> LockResult<RwLockReadGuard<T>> {
if self.waiting_writers.load(Ordering::Relaxed) != 0 {
let _write_queue_lock = self.lock.write();
pub(crate) mod atomic_counter;
pub(crate) mod byte_utils;
pub(crate) mod chacha20;
-#[cfg(feature = "std")]
+#[cfg(all(not(test), feature = "std"))]
pub(crate) mod fairrwlock;
#[cfg(fuzzing)]
pub mod zbase32;
expected_msgs.as_mut().unwrap().push(ev);
}
- fn received_msg(&self, ev: wire::Message<()>) {
+ fn received_msg(&self, _ev: wire::Message<()>) {
let mut msgs = self.expected_recv_msgs.lock().unwrap();
if msgs.is_none() { return; }
assert!(!msgs.as_ref().unwrap().is_empty(), "Received message when we weren't expecting one");
#[cfg(test)]
- assert_eq!(msgs.as_ref().unwrap()[0], ev);
+ assert_eq!(msgs.as_ref().unwrap()[0], _ev);
msgs.as_mut().unwrap().remove(0);
}
}