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

Method _release_save

crates/vm/src/stdlib/_thread.rs:271–279  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

269
270 #[pymethod]
271 fn _release_save(&self, vm: &VirtualMachine) -> PyResult<(usize, u64)> {
272 if !self.mu.is_owned_by_current_thread() {
273 return Err(vm.new_runtime_error("cannot release un-acquired lock"));
274 }
275 let count = self.count.swap(0, core::sync::atomic::Ordering::Relaxed);
276 debug_assert!(count > 0, "RLock count underflow");
277 unsafe { self.mu.unlock() };
278 Ok((count, current_thread_id()))
279 }
280
281 #[pymethod]
282 fn _acquire_restore(&self, state: PyTupleRef, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 4

current_thread_idFunction · 0.70
ErrClass · 0.50
swapMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected