pub struct LockAnalyzer;Expand description
Analyzes pthread lock usage and protected data.
Implementations§
Source§impl LockAnalyzer
impl LockAnalyzer
Sourcepub fn find_lock_regions(&self, func: &HirFunction) -> Vec<LockRegion>
pub fn find_lock_regions(&self, func: &HirFunction) -> Vec<LockRegion>
Find all locked regions in a function.
Identifies pthread_mutex_lock/unlock pairs and returns the code regions they protect.
Sourcepub fn analyze_lock_data_mapping(&self, func: &HirFunction) -> LockDataMapping
pub fn analyze_lock_data_mapping(&self, func: &HirFunction) -> LockDataMapping
Analyze lock-to-data mapping for a function.
Determines which locks protect which data variables based on variable accesses within locked regions.
Sourcepub fn check_lock_discipline(&self, func: &HirFunction) -> Vec<String>
pub fn check_lock_discipline(&self, func: &HirFunction) -> Vec<String>
Check for lock discipline violations.
Detects:
- Locks without unlocks
- Unlocks without locks
- Mismatched lock/unlock pairs
Returns a list of violation descriptions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LockAnalyzer
impl RefUnwindSafe for LockAnalyzer
impl Send for LockAnalyzer
impl Sync for LockAnalyzer
impl Unpin for LockAnalyzer
impl UnwindSafe for LockAnalyzer
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