mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-04 19:25:40 +00:00
docs: document deadlock detector mutex design rationale Add comment explaining why std::sync::Mutex is used instead of tokio::sync::Mutex in the deadlock detector. Refs #744 Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -117,6 +117,12 @@ impl Default for DeadlockDetectorConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Deadlock detector.
|
/// Deadlock detector.
|
||||||
|
/// Deadlock detector using wait-for graphs.
|
||||||
|
///
|
||||||
|
/// Uses `std::sync::Mutex` (not `tokio::sync::Mutex`) because:
|
||||||
|
/// - Locks are never held across `.await` points
|
||||||
|
/// - Critical sections are sub-microsecond (single HashMap operations)
|
||||||
|
/// - `tokio::sync::Mutex` would add unnecessary overhead for these short operations
|
||||||
pub struct DeadlockDetector {
|
pub struct DeadlockDetector {
|
||||||
/// Configuration.
|
/// Configuration.
|
||||||
config: DeadlockDetectorConfig,
|
config: DeadlockDetectorConfig,
|
||||||
|
|||||||
Reference in New Issue
Block a user