MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / exit_thread

Function exit_thread

tests/test_thread_exit.rs:47–61  ·  view source on GitHub ↗
(py: Python)

Source from the content-addressed store, hash-verified

45
46#[allow(unused)]
47fn exit_thread(py: Python) -> PyResult<String> {
48 #[cfg(unix)]
49 {
50 py.allow_threads(|| {
51 // Emulates PyThread_exit_thread. It can happen during Py_Finalize.
52 unsafe { libc::pthread_exit(std::ptr::null_mut()) };
53 })
54 }
55 #[cfg(not(unix))]
56 {
57 let _ = py;
58 // pthread might not exist on this platform.
59 Ok(String::new())
60 }
61}

Callers

nothing calls this directly

Calls 1

allow_threadsMethod · 0.80

Tested by

no test coverage detected