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

Function thread_to_id

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

Get thread ID for a given thread handle (used by start_new_thread)

(handle: &thread::JoinHandle<()>)

Source from the content-addressed store, hash-verified

463
464 /// Get thread ID for a given thread handle (used by start_new_thread)
465 fn thread_to_id(handle: &thread::JoinHandle<()>) -> u64 {
466 #[cfg(unix)]
467 {
468 // On Unix, use pthread ID from the handle
469 use std::os::unix::thread::JoinHandleExt;
470 handle.as_pthread_t() as u64
471 }
472 #[cfg(not(unix))]
473 {
474 thread_to_rust_id(handle.thread())
475 }
476 }
477
478 #[pyfunction]
479 const fn allocate_lock() -> Lock {

Callers 1

start_new_threadFunction · 0.85

Calls 2

thread_to_rust_idFunction · 0.85
threadMethod · 0.45

Tested by

no test coverage detected