1992-08-04 12:41:02 +00:00
|
|
|
#ifndef _THREAD_H_included
|
|
|
|
#define _THREAD_H_included
|
|
|
|
|
1992-09-11 15:19:27 +00:00
|
|
|
#if defined(__STDC__) || defined(__cplusplus)
|
1992-08-04 12:41:02 +00:00
|
|
|
#define _P(args) args
|
|
|
|
#else
|
|
|
|
#define _P(args) ()
|
|
|
|
#endif
|
|
|
|
|
1992-09-11 15:19:27 +00:00
|
|
|
typedef void *type_lock;
|
|
|
|
typedef void *type_sema;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1992-08-04 12:41:02 +00:00
|
|
|
void init_thread _P((void));
|
|
|
|
int start_new_thread _P((void (*)(void *), void *));
|
|
|
|
void exit_thread _P((void));
|
1992-08-17 08:59:08 +00:00
|
|
|
void _exit_thread _P((void));
|
1992-08-04 12:41:02 +00:00
|
|
|
|
|
|
|
type_lock allocate_lock _P((void));
|
|
|
|
void free_lock _P((type_lock));
|
|
|
|
int acquire_lock _P((type_lock, int));
|
|
|
|
#define WAIT_LOCK 1
|
|
|
|
#define NOWAIT_LOCK 0
|
|
|
|
void release_lock _P((type_lock));
|
|
|
|
|
1992-08-17 08:59:08 +00:00
|
|
|
type_sema allocate_sema _P((int));
|
|
|
|
void free_sema _P((type_sema));
|
|
|
|
void down_sema _P((type_sema));
|
|
|
|
void up_sema _P((type_sema));
|
|
|
|
|
1992-08-04 12:41:02 +00:00
|
|
|
void exit_prog _P((int));
|
1992-08-17 08:59:08 +00:00
|
|
|
void _exit_prog _P((int));
|
1992-08-04 12:41:02 +00:00
|
|
|
|
1992-09-11 15:19:27 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1992-08-04 12:41:02 +00:00
|
|
|
#undef _P
|
|
|
|
|
|
|
|
#endif
|