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

Function add_to_shutdown_handles

crates/vm/src/stdlib/_thread.rs:702–709  ·  view source on GitHub ↗

Add a non-daemon thread handle to the shutdown registry

(
        vm: &VirtualMachine,
        inner: &Arc<parking_lot::Mutex<ThreadHandleInner>>,
        done_event: &Arc<(parking_lot::Mutex<bool>, parking_lot::Condvar)>,
    )

Source from the content-addressed store, hash-verified

700
701 /// Add a non-daemon thread handle to the shutdown registry
702 fn add_to_shutdown_handles(
703 vm: &VirtualMachine,
704 inner: &Arc<parking_lot::Mutex<ThreadHandleInner>>,
705 done_event: &Arc<(parking_lot::Mutex<bool>, parking_lot::Condvar)>,
706 ) {
707 let mut handles = vm.state.shutdown_handles.lock();
708 handles.push((Arc::downgrade(inner), Arc::downgrade(done_event)));
709 }
710
711 fn remove_from_shutdown_handles(
712 vm: &VirtualMachine,

Callers 1

start_joinable_threadFunction · 0.85

Calls 2

lockMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected