pub struct LockTrackerV2 { /* private fields */ }Expand description
Tracks lock acquisitions and critical sections (V2 - uses VarId).
Implementations§
Source§impl LockTrackerV2
impl LockTrackerV2
Sourcepub fn acquire(&mut self, acquisition: LockAcquisitionV2)
pub fn acquire(&mut self, acquisition: LockAcquisitionV2)
Record a lock acquisition.
Sourcepub fn record_field_access(
&mut self,
guard_var: VarId,
field_name: &str,
access_kind: AccessKind,
line: u32,
)
pub fn record_field_access( &mut self, guard_var: VarId, field_name: &str, access_kind: AccessKind, line: u32, )
Record a field access within a critical section.
Sourcepub fn mark_expensive(&mut self, guard_var: VarId)
pub fn mark_expensive(&mut self, guard_var: VarId)
Mark a critical section as containing expensive operations.
Sourcepub fn mark_await(&mut self, guard_var: VarId, _await_line: u32)
pub fn mark_await(&mut self, guard_var: VarId, _await_line: u32)
Mark a critical section as containing await point.
Sourcepub fn critical_sections(&self) -> &[CriticalSectionV2]
pub fn critical_sections(&self) -> &[CriticalSectionV2]
Get all completed critical sections.
Sourcepub fn acquisitions(&self) -> &[LockAcquisitionV2]
pub fn acquisitions(&self) -> &[LockAcquisitionV2]
Get all lock acquisitions.
Sourcepub fn acquisitions_by_owner(&self, owner: SymbolId) -> Vec<&LockAcquisitionV2>
pub fn acquisitions_by_owner(&self, owner: SymbolId) -> Vec<&LockAcquisitionV2>
Get lock acquisitions owned by a specific function.
Sourcepub fn active_sections(&self) -> impl Iterator<Item = &CriticalSectionV2>
pub fn active_sections(&self) -> impl Iterator<Item = &CriticalSectionV2>
Get active critical sections.
Sourcepub fn completed_count(&self) -> usize
pub fn completed_count(&self) -> usize
Get the number of completed critical sections.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get the number of active critical sections.
Sourcepub fn flush_active_sections(&mut self)
pub fn flush_active_sections(&mut self)
Flush all active sections to completed sections.
Called at function/scope boundaries where guards are implicitly dropped. Since PureAST has no span info, end_line is left as None.
Trait Implementations§
Source§impl Clone for LockTrackerV2
impl Clone for LockTrackerV2
Source§fn clone(&self) -> LockTrackerV2
fn clone(&self) -> LockTrackerV2
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LockTrackerV2
impl Debug for LockTrackerV2
Source§impl Default for LockTrackerV2
impl Default for LockTrackerV2
Source§fn default() -> LockTrackerV2
fn default() -> LockTrackerV2
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LockTrackerV2
impl RefUnwindSafe for LockTrackerV2
impl Send for LockTrackerV2
impl Sync for LockTrackerV2
impl Unpin for LockTrackerV2
impl UnsafeUnpin for LockTrackerV2
impl UnwindSafe for LockTrackerV2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more