pub struct DeadlockDetector { /* private fields */ }Expand description
Deadlock detector
Implementations§
Source§impl DeadlockDetector
impl DeadlockDetector
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if detection is enabled
Sourcepub fn register_resource(&self, info: ResourceInfo) -> ResourceId
pub fn register_resource(&self, info: ResourceInfo) -> ResourceId
Register a new resource
Sourcepub fn acquire(&self, task_id: TaskId, resource_id: ResourceId)
pub fn acquire(&self, task_id: TaskId, resource_id: ResourceId)
Record a task acquiring a resource
Sourcepub fn release(&self, task_id: TaskId, resource_id: ResourceId)
pub fn release(&self, task_id: TaskId, resource_id: ResourceId)
Record a task releasing a resource
Sourcepub fn wait_for(&self, task_id: TaskId, resource_id: ResourceId)
pub fn wait_for(&self, task_id: TaskId, resource_id: ResourceId)
Record a task waiting for a resource
Sourcepub fn detect_deadlocks(&self) -> Vec<DeadlockCycle>
pub fn detect_deadlocks(&self) -> Vec<DeadlockCycle>
Detect deadlocks using cycle detection
Sourcepub fn get_resources(&self) -> Vec<ResourceInfo>
pub fn get_resources(&self) -> Vec<ResourceInfo>
Get all resources
Sourcepub fn get_resource(&self, id: ResourceId) -> Option<ResourceInfo>
pub fn get_resource(&self, id: ResourceId) -> Option<ResourceInfo>
Get a specific resource
Trait Implementations§
Source§impl Clone for DeadlockDetector
impl Clone for DeadlockDetector
Source§fn clone(&self) -> DeadlockDetector
fn clone(&self) -> DeadlockDetector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeadlockDetector
impl !RefUnwindSafe for DeadlockDetector
impl Send for DeadlockDetector
impl Sync for DeadlockDetector
impl Unpin for DeadlockDetector
impl !UnwindSafe for DeadlockDetector
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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