Files
86Box/src/include/86box/thread.h

47 lines
1.8 KiB
C
Raw Normal View History

2022-04-19 23:06:39 +02:00
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __APPLE__
2022-09-18 17:15:38 -04:00
# define thread_t plat_thread_t
# define event_t plat_event_t
# define mutex_t plat_mutex_t
2022-04-19 23:06:39 +02:00
2022-09-18 17:15:38 -04:00
# define thread_create plat_thread_create
# define thread_wait plat_thread_wait
# define thread_create_event plat_thread_create_event
# define thread_set_event plat_thread_set_event
# define thread_reset_event plat_thread_reset_event
# define thread_wait_event plat_thread_wait_event
# define thread_destroy_event plat_thread_destroy_event
2022-04-19 23:06:39 +02:00
2022-09-18 17:15:38 -04:00
# define thread_create_mutex plat_thread_create_mutex
# define thread_create_mutex_with_spin_count plat_thread_create_mutex_with_spin_count
# define thread_close_mutex plat_thread_close_mutex
# define thread_wait_mutex plat_thread_wait_mutex
# define thread_release_mutex plat_thread_release_mutex
2022-04-19 23:06:39 +02:00
#endif
/* Thread support. */
typedef void thread_t;
typedef void event_t;
typedef void mutex_t;
2022-09-18 17:15:38 -04:00
extern thread_t *thread_create(void (*thread_func)(void *param), void *param);
extern int thread_wait(thread_t *arg);
extern event_t *thread_create_event(void);
extern void thread_set_event(event_t *arg);
extern void thread_reset_event(event_t *arg);
extern int thread_wait_event(event_t *arg, int timeout);
extern void thread_destroy_event(event_t *arg);
2022-04-19 23:06:39 +02:00
2022-09-18 17:15:38 -04:00
extern mutex_t *thread_create_mutex(void);
extern void thread_close_mutex(mutex_t *arg);
extern int thread_test_mutex(mutex_t *arg);
extern int thread_wait_mutex(mutex_t *arg);
extern int thread_release_mutex(mutex_t *mutex);
2022-04-19 23:06:39 +02:00
#ifdef __cplusplus
}
#endif