blob: e29f7e63bfec41c7da54761cac4e246cb490ccb9 [file] [log] [blame]
Guido van Rossum1984f1e1992-08-04 12:41:02 +00001#ifndef _THREAD_H_included
2#define _THREAD_H_included
3
Sjoerd Mullenderd10d8291992-09-11 15:19:27 +00004#if defined(__STDC__) || defined(__cplusplus)
Guido van Rossum1984f1e1992-08-04 12:41:02 +00005#define _P(args) args
6#else
7#define _P(args) ()
8#endif
9
Sjoerd Mullenderd10d8291992-09-11 15:19:27 +000010typedef void *type_lock;
11typedef void *type_sema;
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
Guido van Rossum1984f1e1992-08-04 12:41:02 +000017void init_thread _P((void));
18int start_new_thread _P((void (*)(void *), void *));
19void exit_thread _P((void));
Guido van Rossumf9f2e821992-08-17 08:59:08 +000020void _exit_thread _P((void));
Guido van Rossum1984f1e1992-08-04 12:41:02 +000021
Guido van Rossum1984f1e1992-08-04 12:41:02 +000022type_lock allocate_lock _P((void));
23void free_lock _P((type_lock));
24int acquire_lock _P((type_lock, int));
25#define WAIT_LOCK 1
26#define NOWAIT_LOCK 0
27void release_lock _P((type_lock));
28
Guido van Rossumf9f2e821992-08-17 08:59:08 +000029type_sema allocate_sema _P((int));
30void free_sema _P((type_sema));
31void down_sema _P((type_sema));
32void up_sema _P((type_sema));
33
Guido van Rossum1984f1e1992-08-04 12:41:02 +000034void exit_prog _P((int));
Guido van Rossumf9f2e821992-08-17 08:59:08 +000035void _exit_prog _P((int));
Guido van Rossum1984f1e1992-08-04 12:41:02 +000036
Sjoerd Mullenderd10d8291992-09-11 15:19:27 +000037#ifdef __cplusplus
38}
39#endif
40
Guido van Rossum1984f1e1992-08-04 12:41:02 +000041#undef _P
42
43#endif