blob: b1504b6cdb7d3ad7337e46d35c36f6022f727726 [file] [log] [blame]
Guido van Rossum1984f1e1992-08-04 12:41:02 +00001
Fred Drake3cf4d2b2000-07-09 00:55:06 +00002#ifndef Py_PYTHREAD_H
3#define Py_PYTHREAD_H
4
Guido van Rossum65d5b571998-12-21 19:32:43 +00005#define NO_EXIT_PROG /* don't define PyThread_exit_prog() */
Guido van Rossumb6775db1994-08-01 11:34:53 +00006 /* (the result is no use of signals on SGI) */
7
Guido van Rossum65d5b571998-12-21 19:32:43 +00008typedef void *PyThread_type_lock;
9typedef void *PyThread_type_sema;
Sjoerd Mullenderd10d8291992-09-11 15:19:27 +000010
11#ifdef __cplusplus
12extern "C" {
13#endif
14
Fred Drake3cf4d2b2000-07-09 00:55:06 +000015DL_IMPORT(void) PyThread_init_thread(void);
Guido van Rossum3c288632001-10-16 21:13:49 +000016DL_IMPORT(long) PyThread_start_new_thread(void (*)(void *), void *);
Fred Drake3cf4d2b2000-07-09 00:55:06 +000017DL_IMPORT(void) PyThread_exit_thread(void);
18DL_IMPORT(void) PyThread__PyThread_exit_thread(void);
19DL_IMPORT(long) PyThread_get_thread_ident(void);
Guido van Rossum1984f1e1992-08-04 12:41:02 +000020
Fred Drake3cf4d2b2000-07-09 00:55:06 +000021DL_IMPORT(PyThread_type_lock) PyThread_allocate_lock(void);
22DL_IMPORT(void) PyThread_free_lock(PyThread_type_lock);
23DL_IMPORT(int) PyThread_acquire_lock(PyThread_type_lock, int);
Guido van Rossum1984f1e1992-08-04 12:41:02 +000024#define WAIT_LOCK 1
25#define NOWAIT_LOCK 0
Fred Drake3cf4d2b2000-07-09 00:55:06 +000026DL_IMPORT(void) PyThread_release_lock(PyThread_type_lock);
Guido van Rossum1984f1e1992-08-04 12:41:02 +000027
Guido van Rossumb6775db1994-08-01 11:34:53 +000028#ifndef NO_EXIT_PROG
Fred Drake3cf4d2b2000-07-09 00:55:06 +000029DL_IMPORT(void) PyThread_exit_prog(int);
30DL_IMPORT(void) PyThread__PyThread_exit_prog(int);
Guido van Rossumb6775db1994-08-01 11:34:53 +000031#endif
Guido van Rossum1984f1e1992-08-04 12:41:02 +000032
Fred Drake3cf4d2b2000-07-09 00:55:06 +000033DL_IMPORT(int) PyThread_create_key(void);
34DL_IMPORT(void) PyThread_delete_key(int);
35DL_IMPORT(int) PyThread_set_key_value(int, void *);
36DL_IMPORT(void *) PyThread_get_key_value(int);
Guido van Rossuma027efa1997-05-05 20:56:21 +000037
Sjoerd Mullenderd10d8291992-09-11 15:19:27 +000038#ifdef __cplusplus
39}
40#endif
41
Guido van Rossumd023a781999-03-24 19:02:09 +000042#endif /* !Py_PYTHREAD_H */