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

Method try_lock_shared_recursive

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

Source from the content-addressed store, hash-verified

190
191 #[inline]
192 fn try_lock_shared_recursive(&self) -> bool {
193 if self.is_exclusive() {
194 false
195 } else if let Some(new) = self.state.get().checked_add(ONE_READER) {
196 self.state.set(new);
197 true
198 } else {
199 false
200 }
201 }
202}
203
204#[cold]

Callers 2

try_lock_sharedMethod · 0.80
lock_shared_recursiveMethod · 0.80

Calls 3

is_exclusiveMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected