MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_lock_contended

Function is_lock_contended

atomic-repository/src/repository/locks.rs:635–639  ·  view source on GitHub ↗

Classify the cross-platform error returned by a contended `fs2` try-lock.

(error: &std::io::Error)

Source from the content-addressed store, hash-verified

633
634/// Classify the cross-platform error returned by a contended `fs2` try-lock.
635pub(super) fn is_lock_contended(error: &std::io::Error) -> bool {
636 error.kind() == std::io::ErrorKind::WouldBlock
637 || (error.raw_os_error().is_some()
638 && error.raw_os_error() == fs2::lock_contended_error().raw_os_error())
639}

Callers 1

try_lock_fileFunction · 0.70

Calls 1

kindMethod · 0.45

Tested by

no test coverage detected