Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 1 | #ifndef _THREAD_H_included |
| 2 | #define _THREAD_H_included |
| 3 | |
Sjoerd Mullender | d10d829 | 1992-09-11 15:19:27 +0000 | [diff] [blame] | 4 | #if defined(__STDC__) || defined(__cplusplus) |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 5 | #define _P(args) args |
| 6 | #else |
| 7 | #define _P(args) () |
| 8 | #endif |
| 9 | |
Sjoerd Mullender | d10d829 | 1992-09-11 15:19:27 +0000 | [diff] [blame] | 10 | typedef void *type_lock; |
| 11 | typedef void *type_sema; |
| 12 | |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 17 | void init_thread _P((void)); |
| 18 | int start_new_thread _P((void (*)(void *), void *)); |
| 19 | void exit_thread _P((void)); |
Guido van Rossum | f9f2e82 | 1992-08-17 08:59:08 +0000 | [diff] [blame] | 20 | void _exit_thread _P((void)); |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 21 | |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 22 | type_lock allocate_lock _P((void)); |
| 23 | void free_lock _P((type_lock)); |
| 24 | int acquire_lock _P((type_lock, int)); |
| 25 | #define WAIT_LOCK 1 |
| 26 | #define NOWAIT_LOCK 0 |
| 27 | void release_lock _P((type_lock)); |
| 28 | |
Guido van Rossum | f9f2e82 | 1992-08-17 08:59:08 +0000 | [diff] [blame] | 29 | type_sema allocate_sema _P((int)); |
| 30 | void free_sema _P((type_sema)); |
| 31 | void down_sema _P((type_sema)); |
| 32 | void up_sema _P((type_sema)); |
| 33 | |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 34 | void exit_prog _P((int)); |
Guido van Rossum | f9f2e82 | 1992-08-17 08:59:08 +0000 | [diff] [blame] | 35 | void _exit_prog _P((int)); |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 36 | |
Sjoerd Mullender | d10d829 | 1992-09-11 15:19:27 +0000 | [diff] [blame] | 37 | #ifdef __cplusplus |
| 38 | } |
| 39 | #endif |
| 40 | |
Guido van Rossum | 1984f1e | 1992-08-04 12:41:02 +0000 | [diff] [blame] | 41 | #undef _P |
| 42 | |
| 43 | #endif |