File indexing completed on 2025-01-18 10:06:41
0001 #ifndef Py_CPYTHON_PYTHREAD_H
0002 # error "this header file must not be included directly"
0003 #endif
0004
0005 #define PYTHREAD_INVALID_THREAD_ID ((unsigned long)-1)
0006
0007 #ifdef HAVE_FORK
0008
0009
0010
0011 PyAPI_FUNC(int) _PyThread_at_fork_reinit(PyThread_type_lock *lock);
0012 #endif
0013
0014 #ifdef HAVE_PTHREAD_H
0015
0016 # include <pthread.h>
0017 # define NATIVE_TSS_KEY_T pthread_key_t
0018 #elif defined(NT_THREADS)
0019
0020
0021
0022 # define NATIVE_TSS_KEY_T unsigned long
0023 #elif defined(HAVE_PTHREAD_STUBS)
0024 # include "cpython/pthread_stubs.h"
0025 # define NATIVE_TSS_KEY_T pthread_key_t
0026 #else
0027 # error "Require native threads. See https://bugs.python.org/issue31370"
0028 #endif
0029
0030
0031
0032
0033
0034 struct _Py_tss_t {
0035 int _is_initialized;
0036 NATIVE_TSS_KEY_T _key;
0037 };
0038
0039 #undef NATIVE_TSS_KEY_T
0040
0041
0042 #define Py_tss_NEEDS_INIT {0}