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

Method try_lock_shared

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

Source from the content-addressed store, hash-verified

82
83 #[inline]
84 fn try_lock_shared(&self) -> bool {
85 // TODO: figure out whether this is realistic; could maybe help
86 // debug deadlocks from 2+ read() in the same thread?
87 // if self.is_locked() {
88 // false
89 // } else {
90 // self.state.set(ONE_READER);
91 // true
92 // }
93 self.try_lock_shared_recursive()
94 }
95
96 #[inline]
97 unsafe fn unlock_shared(&self) {

Callers 2

lock_sharedMethod · 0.80
try_lock_upgradableMethod · 0.80

Calls 1

Tested by

no test coverage detected