Updated for 2.1a3
[python/dscho.git] / Include / pythread.h
blobc0a718e5ade187b7f3917688846d0347dbc1eb2b
2 #ifndef Py_PYTHREAD_H
3 #define Py_PYTHREAD_H
5 #define NO_EXIT_PROG /* don't define PyThread_exit_prog() */
6 /* (the result is no use of signals on SGI) */
8 typedef void *PyThread_type_lock;
9 typedef void *PyThread_type_sema;
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
15 DL_IMPORT(void) PyThread_init_thread(void);
16 DL_IMPORT(int) PyThread_start_new_thread(void (*)(void *), void *);
17 DL_IMPORT(void) PyThread_exit_thread(void);
18 DL_IMPORT(void) PyThread__PyThread_exit_thread(void);
19 DL_IMPORT(long) PyThread_get_thread_ident(void);
21 DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock(void);
22 DL_IMPORT(void) PyThread_free_lock(PyThread_type_lock);
23 DL_IMPORT(int) PyThread_acquire_lock(PyThread_type_lock, int);
24 #define WAIT_LOCK 1
25 #define NOWAIT_LOCK 0
26 DL_IMPORT(void) PyThread_release_lock(PyThread_type_lock);
28 DL_IMPORT(PyThread_type_sema) PyThread_allocate_sema(int);
29 DL_IMPORT(void) PyThread_free_sema(PyThread_type_sema);
30 DL_IMPORT(int) PyThread_down_sema(PyThread_type_sema, int);
31 #define WAIT_SEMA 1
32 #define NOWAIT_SEMA 0
33 DL_IMPORT(void) PyThread_up_sema(PyThread_type_sema);
35 #ifndef NO_EXIT_PROG
36 DL_IMPORT(void) PyThread_exit_prog(int);
37 DL_IMPORT(void) PyThread__PyThread_exit_prog(int);
38 #endif
40 DL_IMPORT(int) PyThread_create_key(void);
41 DL_IMPORT(void) PyThread_delete_key(int);
42 DL_IMPORT(int) PyThread_set_key_value(int, void *);
43 DL_IMPORT(void *) PyThread_get_key_value(int);
45 #ifdef __cplusplus
47 #endif
49 #endif /* !Py_PYTHREAD_H */