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

Function release_lock

crates/vm/src/stdlib/_imp.rs:23–30  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

21
22 #[pyfunction]
23 fn release_lock(vm: &VirtualMachine) -> PyResult<()> {
24 if !IMP_LOCK.is_locked() {
25 Err(vm.new_runtime_error("Global import lock not held"))
26 } else {
27 unsafe { IMP_LOCK.unlock() };
28 Ok(())
29 }
30 }
31
32 #[pyfunction]
33 fn lock_held(_vm: &VirtualMachine) -> bool {

Callers

nothing calls this directly

Calls 3

is_lockedMethod · 0.80
ErrClass · 0.50
unlockMethod · 0.45

Tested by

no test coverage detected