pub struct AtomicI32(/* private fields */);Expand description
Creusot wrapper around std::sync::atomic::AtomicI32
Implementations§
Source§impl AtomicI32
impl AtomicI32
Sourcepub fn new(val: i32) -> (Self, Ghost<Box<Perm<AtomicI32>>>)
pub fn new(val: i32) -> (Self, Ghost<Box<Perm<AtomicI32>>>)
ensures
*result.1.val() == valensures
*result.1.ward() == result.0terminates
Sourcepub fn fetch_add<'a, A, F>(&'a self, val: i32, f: Ghost<F>) -> (i32, Ghost<A>)
pub fn fetch_add<'a, A, F>(&'a self, val: i32, f: Ghost<F>) -> (i32, Ghost<A>)
Wrapper for std::sync::atomic::AtomicI32::fetch_add.
The fetch and the store are always sequentially consistent.
requires
forall<c: &mut Committer> !c.shot() ==> c.ward() == *self ==> c.new_value() == val + c.old_value() ==> f.precondition((c,)) && (forall<r> f.postcondition_once((c,), r) ==> (^c).shot())
ensures
exists<c: &mut Committer> !c.shot() && c.ward() == *self && c.new_value() == val + c.old_value() && c.old_value() == result.0 && f.postcondition_once((c,), *(result.1))
Sourcepub fn store<'a, A, F>(&'a self, val: i32, f: Ghost<F>) -> Ghost<A>
pub fn store<'a, A, F>(&'a self, val: i32, f: Ghost<F>) -> Ghost<A>
Wrapper for std::sync::atomic::AtomicI32::store.
The store is always sequentially consistent.
requires
forall<c: &mut Committer> !c.shot() ==> c.ward() == *self ==> c.new_value() == val ==> f.precondition((c,)) && (forall<r> f.postcondition_once((c,), r) ==> (^c).shot())
ensures
exists<c: &mut Committer> !c.shot() && c.ward() == *self && c.new_value() == val && f.postcondition_once((c,), *result)
Sourcepub fn into_inner(self, own: Ghost<Box<Perm<AtomicI32>>>) -> i32
pub fn into_inner(self, own: Ghost<Box<Perm<AtomicI32>>>) -> i32
Wrapper for std::sync::atomic::AtomicI32::into_inner.
requires
self == *own.ward()ensures
result == *own.val()Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AtomicI32
impl RefUnwindSafe for AtomicI32
impl Send for AtomicI32
impl Sync for AtomicI32
impl Unpin for AtomicI32
impl UnwindSafe for AtomicI32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more