blob: dfd61575ea1095ae37cded560954a07c5ec3b215 [file] [log] [blame]
Andrew Hsieh83760d22013-06-18 12:24:28 -07001
2#ifndef Py_PYTHREAD_H
3#define Py_PYTHREAD_H
4
5typedef void *PyThread_type_lock;
6typedef void *PyThread_type_sema;
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12PyAPI_FUNC(void) PyThread_init_thread(void);
13PyAPI_FUNC(long) PyThread_start_new_thread(void (*)(void *), void *);
14PyAPI_FUNC(void) PyThread_exit_thread(void);
15PyAPI_FUNC(long) PyThread_get_thread_ident(void);
16
17PyAPI_FUNC(PyThread_type_lock) PyThread_allocate_lock(void);
18PyAPI_FUNC(void) PyThread_free_lock(PyThread_type_lock);
19PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int);
20#define WAIT_LOCK 1
21#define NOWAIT_LOCK 0
22PyAPI_FUNC(void) PyThread_release_lock(PyThread_type_lock);
23
24PyAPI_FUNC(size_t) PyThread_get_stacksize(void);
25PyAPI_FUNC(int) PyThread_set_stacksize(size_t);
26
27/* Thread Local Storage (TLS) API */
28PyAPI_FUNC(int) PyThread_create_key(void);
29PyAPI_FUNC(void) PyThread_delete_key(int);
30PyAPI_FUNC(int) PyThread_set_key_value(int, void *);
31PyAPI_FUNC(void *) PyThread_get_key_value(int);
32PyAPI_FUNC(void) PyThread_delete_key_value(int key);
33
34/* Cleanup after a fork */
35PyAPI_FUNC(void) PyThread_ReInitTLS(void);
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif /* !Py_PYTHREAD_H */