fix(runtime): replace deprecated atomic fetch_update calls
Intrepid/Prometeu/Runtime/pipeline/head There was a failure building this commit
Intrepid/Prometeu/Runtime/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -9,11 +9,9 @@ pub const GUEST_BYTES: usize = 4096;
|
||||
static NEXT_CONTEXT: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);
|
||||
fn next_context() -> Result<u64> {
|
||||
NEXT_CONTEXT
|
||||
.fetch_update(
|
||||
std::sync::atomic::Ordering::SeqCst,
|
||||
std::sync::atomic::Ordering::SeqCst,
|
||||
|n| n.checked_add(1).filter(|&next| next <= i64::MAX as u64),
|
||||
)
|
||||
.try_update(std::sync::atomic::Ordering::SeqCst, std::sync::atomic::Ordering::SeqCst, |n| {
|
||||
n.checked_add(1).filter(|&next| next <= i64::MAX as u64)
|
||||
})
|
||||
.map_err(|_| Error::CounterExhausted)
|
||||
}
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
||||
Reference in New Issue
Block a user