pub struct CpuLocalPointsTo<V> { /* private fields */ }Expand description
Exclusive ownership of one CPU’s entry in a CPU-local object.
Two live points-to resources associated with the same
CpuLocalAuth necessarily refer to different CPUs. Holding this
token does not by itself establish that the holder is currently executing
on that CPU; the scheduler glue must additionally bind cpu() to its
current-CPU token.
Implementations§
Source§impl<V> CpuLocalPointsTo<V>
impl<V> CpuLocalPointsTo<V>
Sourcepub closed spec fn id(&self) -> Loc
pub closed spec fn id(&self) -> Loc
Identity of the corresponding CpuLocalAuth.
Sourcepub proof fn lemma_agree(tracked &self, tracked auth: &CpuLocalAuth<V>)
pub proof fn lemma_agree(tracked &self, tracked auth: &CpuLocalAuth<V>)
requires
self.id() == auth.id(),ensuresauth.cpus().contains(self.cpu()),auth.value(self.cpu()) == self.value(),Establishes agreement with the authoritative CPU-local contents.
Sourcepub proof fn tracked_update(tracked &mut self, tracked auth: &mut CpuLocalAuth<V>, value: V)
pub proof fn tracked_update(tracked &mut self, tracked auth: &mut CpuLocalAuth<V>, value: V)
requires
old(self).id() == old(auth).id(),ensuresfinal(self).id() == old(self).id(),final(self).cpu() == old(self).cpu(),final(self).value() == value,final(auth).id() == old(auth).id(),final(auth).cpus() == old(auth).cpus(),final(auth)@ == old(auth)@.insert(old(self).cpu(), value),Updates this CPU’s logical value.
Other CPUs’ points-to resources remain disjoint and retain their values.
Sourcepub proof fn lemma_distinct(tracked &mut self, tracked other: &CpuLocalPointsTo<V>)
pub proof fn lemma_distinct(tracked &mut self, tracked other: &CpuLocalPointsTo<V>)
requires
old(self).id() == other.id(),ensuresfinal(self).id() == old(self).id(),final(self).cpu() == old(self).cpu(),final(self).value() == old(self).value(),final(self).cpu() != other.cpu(),Two points-to resources belonging to one authority refer to distinct CPUs.
Sourcepub proof fn lemma_same_cpu_has_distinct_auth(tracked &mut self, tracked other: &CpuLocalPointsTo<V>)
pub proof fn lemma_same_cpu_has_distinct_auth(tracked &mut self, tracked other: &CpuLocalPointsTo<V>)
requires
old(self).cpu() == other.cpu(),ensuresfinal(self).id() == old(self).id(),final(self).cpu() == old(self).cpu(),final(self).value() == old(self).value(),final(self).id() != other.id(),Two live points-to resources for the same CPU cannot belong to the same CPU-local authority.
Trait Implementations§
Source§impl<V> CpuCoreLocalState for CpuLocalPointsTo<V>
impl<V> CpuCoreLocalState for CpuLocalPointsTo<V>
Auto Trait Implementations§
impl<V> Freeze for CpuLocalPointsTo<V>
impl<V> RefUnwindSafe for CpuLocalPointsTo<V>where
V: RefUnwindSafe,
impl<V> Send for CpuLocalPointsTo<V>where
V: Send,
impl<V> Sync for CpuLocalPointsTo<V>where
V: Sync,
impl<V> Unpin for CpuLocalPointsTo<V>where
V: Unpin,
impl<V> UnsafeUnpin for CpuLocalPointsTo<V>
impl<V> UnwindSafe for CpuLocalPointsTo<V>where
V: UnwindSafe,
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