MCPcopy Index your code
hub / github.com/RustPython/RustPython / try_lock_exclusive

Method try_lock_exclusive

crates/common/src/lock/cell_lock.rs:110–117  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

108
109 #[inline]
110 fn try_lock_exclusive(&self) -> bool {
111 if self.is_locked() {
112 false
113 } else {
114 self.state.set(WRITER_BIT);
115 true
116 }
117 }
118
119 unsafe fn unlock_exclusive(&self) {
120 self.state.set(0)

Callers 1

lock_exclusiveMethod · 0.80

Calls 2

is_lockedMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected