pyo3_ffi/pythread.rs
1use core::ffi::{c_int, c_void};
2
3// skipped PyThread_type_lock
4// skipped PyLockStatus
5// skipped PyThread_init_thread
6// skipped PyThread_start_new_thread
7// skipped PyThread_exit_thread
8// skipped PyThread_get_thread_ident
9// skipped PyThread_get_thread_native_id
10// skipped PyThread_allocate_lock
11// skipped PyThread_free_lock
12// skipped PyThread_acquire_lock
13// skipped WAIT_LOCK
14// skipped NOWAIT_LOCK
15// skipped PY_TIMEOUT_T
16// skipped PyThread_acquire_lock_timed
17// skipped PyThread_release_lock
18// skipped PyThread_get_stacksize
19// skipped PyThread_set_stacksize
20// skipped PyThread_GetInfo
21// skipped PyThread_create_key
22// skipped PyThread_delete_key
23// skipped PyThread_set_key_value
24// skipped PyThread_get_key_value
25// skipped PyThread_delete_key_value
26// skipped PyThread_ReInitTLS
27
28#[cfg(Py_LIMITED_API)]
29opaque_struct!(pub Py_tss_t);
30
31#[cfg(not(Py_LIMITED_API))]
32use crate::cpython::Py_tss_t;
33
34extern_libpython! {
35 pub fn PyThread_tss_alloc() -> *mut Py_tss_t;
36 pub fn PyThread_tss_free(key: *mut Py_tss_t);
37
38 pub fn PyThread_tss_is_created(key: *mut Py_tss_t) -> c_int;
39 pub fn PyThread_tss_create(key: *mut Py_tss_t) -> c_int;
40 pub fn PyThread_tss_delete(key: *mut Py_tss_t);
41 pub fn PyThread_tss_set(key: *mut Py_tss_t, value: *mut c_void) -> c_int;
42 pub fn PyThread_tss_get(key: *mut Py_tss_t) -> *mut c_void;
43}