pub struct LockDisciplineChecker<'a> { /* private fields */ }Expand description
Lock discipline checker.
Validates lock discipline for pthread mutex usage in C code.
Implementations§
Source§impl<'a> LockDisciplineChecker<'a>
impl<'a> LockDisciplineChecker<'a>
Sourcepub fn new(analyzer: &'a LockAnalyzer) -> Self
pub fn new(analyzer: &'a LockAnalyzer) -> Self
Create a new lock discipline checker.
§Arguments
analyzer- Lock analyzer for identifying protected data and lock regions
Sourcepub fn check_unprotected_access(&self, func: &HirFunction) -> Vec<String>
pub fn check_unprotected_access(&self, func: &HirFunction) -> Vec<String>
Check for unprotected data accesses.
Detects when shared data (identified by lock analysis) is accessed outside of locked regions.
§Arguments
func- Function to check
§Returns
Vector of violation messages, each describing:
- The variable name accessed
- The statement number where the violation occurs
§Example
let checker = LockDisciplineChecker::new(&analyzer);
let violations = checker.check_unprotected_access(&func);
for violation in violations {
println!("Lock violation: {}", violation);
}Sourcepub fn check_deadlock_risk(&self, functions: &[HirFunction]) -> Vec<String>
pub fn check_deadlock_risk(&self, functions: &[HirFunction]) -> Vec<String>
Check for potential deadlocks
Analyzes lock ordering across multiple functions to detect inconsistent lock acquisition patterns that could cause deadlocks.
Sourcepub fn check_all(&self, func: &HirFunction) -> LockDisciplineReport
pub fn check_all(&self, func: &HirFunction) -> LockDisciplineReport
Comprehensive lock discipline check
Runs all lock discipline checks and returns a summary report.
Auto Trait Implementations§
impl<'a> Freeze for LockDisciplineChecker<'a>
impl<'a> RefUnwindSafe for LockDisciplineChecker<'a>
impl<'a> Send for LockDisciplineChecker<'a>
impl<'a> Sync for LockDisciplineChecker<'a>
impl<'a> Unpin for LockDisciplineChecker<'a>
impl<'a> UnsafeUnpin for LockDisciplineChecker<'a>
impl<'a> UnwindSafe for LockDisciplineChecker<'a>
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