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

Function py_os_before_fork

crates/vm/src/stdlib/posix.rs:764–776  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

762 }
763
764 fn py_os_before_fork(vm: &VirtualMachine) {
765 let before_forkers: Vec<PyObjectRef> = vm.state.before_forkers.lock().clone();
766 // functions must be executed in reversed order as they are registered
767 // only for before_forkers, refer: test_register_at_fork in test_posix
768
769 run_at_forkers(before_forkers, true, vm);
770
771 #[cfg(feature = "threading")]
772 crate::stdlib::_imp::acquire_imp_lock_for_fork();
773
774 #[cfg(feature = "threading")]
775 vm.state.stop_the_world.stop_the_world(vm);
776 }
777
778 fn py_os_after_fork_child(vm: &VirtualMachine) {
779 #[cfg(feature = "threading")]

Callers 1

forkFunction · 0.85

Calls 5

run_at_forkersFunction · 0.85
stop_the_worldMethod · 0.80
cloneMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected