Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/RustPython/RustPython
/ try_lock
Method
try_lock
crates/common/src/lock/cell_lock.rs:32–39 ·
view source on GitHub ↗
(&self)
Source
from the content-addressed store, hash-verified
30
31
#[inline]
32
fn try_lock(&self) -> bool {
33
if self.is_locked() {
34
false
35
} else {
36
self.locked.set(true);
37
true
38
}
39
}
40
41
unsafe fn unlock(&self) {
42
self.locked.set(false)
Callers
nothing calls this directly
Calls
2
is_locked
Method · 0.80
set
Method · 0.45
Tested by
no test coverage detected