Get thread ID for a given thread handle (used by start_new_thread)
(handle: &thread::JoinHandle<()>)
| 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 { |
no test coverage detected