pub struct AtomicUsize(/* private fields */);Expand description
Creusot wrapper around std::sync::atomic::AtomicUsize.
Implementations§
Source§impl AtomicUsize
impl AtomicUsize
Sourcepub fn new(
val: usize,
view: Ghost<&mut SyncView>,
) -> (Self, Ghost<Box<Perm<AtomicUsize>>>)
pub fn new( val: usize, view: Ghost<&mut SyncView>, ) -> (Self, Ghost<Box<Perm<AtomicUsize>>>)
ensures
*result.1.val() == FMap::singleton(result.0.get_timestamp(^view), (val, **view))
ensures
*result.1.ward() == result.0terminates
Sourcepub fn load<F>(&self, f: Ghost<F>) -> usize
pub fn load<F>(&self, f: Ghost<F>) -> usize
Wrapper for std::sync::atomic::AtomicUsize::load.
requires
forall<c: &LoadCommitter<$type, Self>> c.ward() == *self ==> f.precondition((c,))
ensures
exists<c: &LoadCommitter<$type, Self>> c.ward() == *self && c.val() == result && f.postcondition_once((c,), ())
Sourcepub fn store<F>(&self, val: usize, f: Ghost<F>)
pub fn store<F>(&self, val: usize, f: Ghost<F>)
Wrapper for std::sync::atomic::AtomicUsize::store.
requires
forall<c: &mut StoreCommitter<$type, Self>> !c.shot() ==> c.ward() == *self ==> c.val() == val ==> f.precondition((c,)) && f.postcondition_once((c,), ()) ==> (^c).shot()
ensures
exists<c: &mut StoreCommitter<$type, Self>> !c.shot() && c.ward() == *self && c.val() == val && f.postcondition_once((c,), ())
Trait Implementations§
Source§impl Container for AtomicUsize
impl Container for AtomicUsize
Source§impl HasTimestamp for AtomicUsize
impl HasTimestamp for AtomicUsize
Source§fn get_timestamp(self, _: SyncView) -> Timestamp
fn get_timestamp(self, _: SyncView) -> Timestamp
logic(opaque) ⚠
Source§fn get_timestamp_monotonic(self, x: SyncView, y: SyncView)
fn get_timestamp_monotonic(self, x: SyncView, y: SyncView)
logic(law) ⚠
requires
x.le_log(y)ensures
self.get_timestamp(x).le_log(self.get_timestamp(y))Auto Trait Implementations§
impl !Freeze for AtomicUsize
impl Objective for AtomicUsize
impl RefUnwindSafe for AtomicUsize
impl Send for AtomicUsize
impl Sync for AtomicUsize
impl Unpin for AtomicUsize
impl UnsafeUnpin for AtomicUsize
impl UnwindSafe for AtomicUsize
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