3 cdef extern from "pythread.h":
5 ctypedef void *PyThread_type_lock
6 ctypedef void *PyThread_type_sema
8 void PyThread_init_thread()
9 long PyThread_start_new_thread(void (*)(void *), void *)
10 void PyThread_exit_thread()
11 long PyThread_get_thread_ident()
13 PyThread_type_lock PyThread_allocate_lock()
14 void PyThread_free_lock(PyThread_type_lock)
15 int PyThread_acquire_lock(PyThread_type_lock, int mode) nogil
16 void PyThread_release_lock(PyThread_type_lock) nogil
19 # 'mode' in PyThread_acquire_lock()
23 ctypedef enum PyLockStatus:
24 # return values of PyThread_acquire_lock() in CPython 3.2+
29 size_t PyThread_get_stacksize()
30 int PyThread_set_stacksize(size_t)
32 # Thread Local Storage (TLS) API
33 int PyThread_create_key()
34 void PyThread_delete_key(int)
35 int PyThread_set_key_value(int, void *)
36 void * PyThread_get_key_value(int)
37 void PyThread_delete_key_value(int key)
39 # Cleanup after a fork
40 void PyThread_ReInitTLS()