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

Function reinit_std_streams_after_fork

crates/vm/src/stdlib/_io.rs:5003–5010  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

5001 /// after `fork()`, before any other thread is created.
5002 #[cfg(all(unix, feature = "threading"))]
5003 pub unsafe fn reinit_std_streams_after_fork(vm: &VirtualMachine) {
5004 for name in ["stdin", "stdout", "stderr"] {
5005 let Ok(stream) = vm.sys_module.get_attr(name, vm) else {
5006 continue;
5007 };
5008 reinit_io_locks(&stream);
5009 }
5010 }
5011
5012 #[cfg(all(unix, feature = "threading"))]
5013 fn reinit_io_locks(obj: &PyObject) {

Callers 1

py_os_after_fork_childFunction · 0.85

Calls 2

reinit_io_locksFunction · 0.85
get_attrMethod · 0.45

Tested by

no test coverage detected