use core::sync::atomic::{AtomicU32, Ordering};
use core::time::Duration;
use crate::{ErrorKind, Result};
pub(crate) fn wait(atomic: &AtomicU32, expected: u32, timeout: Option<Duration>) -> Result<bool> {
if atomic.load(Ordering::SeqCst) != expected {
return Ok(true);
}
match timeout {
None => Err(ErrorKind::Deadlock.into()),
Some(Duration::ZERO) => Ok(false),
Some(_) => Err(ErrorKind::Unsupported.into()),
}
}
pub(crate) fn wake(_atomic: &AtomicU32, _all: bool) {}