pub struct AtomicBool(/* private fields */);Expand description
Creusot wrapper around std::sync::atomic::AtomicBool.
Implementations§
Source§impl AtomicBool
impl AtomicBool
Sourcepub fn new(
val: bool,
view: Ghost<&mut SyncView>,
) -> (Self, Ghost<Box<Perm<AtomicBool>>>)
pub fn new( val: bool, view: Ghost<&mut SyncView>, ) -> (Self, Ghost<Box<Perm<AtomicBool>>>)
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>) -> bool
pub fn load<F>(&self, f: Ghost<F>) -> bool
Wrapper for std::sync::atomic::AtomicBool::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: bool, f: Ghost<F>)
pub fn store<F>(&self, val: bool, f: Ghost<F>)
Wrapper for std::sync::atomic::AtomicBool::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 AtomicBool
impl Container for AtomicBool
Source§impl HasTimestamp for AtomicBool
impl HasTimestamp for AtomicBool
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 AtomicBool
impl Objective for AtomicBool
impl RefUnwindSafe for AtomicBool
impl Send for AtomicBool
impl Sync for AtomicBool
impl Unpin for AtomicBool
impl UnsafeUnpin for AtomicBool
impl UnwindSafe for AtomicBool
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