22#include "freeciv_config.h"
27#ifdef FREECIV_HAVE_TINYCTHR
28#include "fc_tinycthread.h"
29#define FREECIV_C11_THR
31#ifdef FREECIV_HAVE_C11_THREADS
33#define FREECIV_C11_THR
39#define fc_thread thrd_t
41#define fc_thread_cond cnd_t
42#define fc_thread_id thrd_t
44#elif defined(FREECIV_HAVE_PTHREAD)
48#define fc_thread pthread_t
49#define fc_mutex pthread_mutex_t
50#define fc_thread_cond pthread_cond_t
51#define fc_thread_id pthread_t
53#elif defined (FREECIV_HAVE_WINTHREADS)
56#define fc_thread HANDLE *
57#define fc_mutex HANDLE *
58#define fc_thread_id DWORD
60#ifndef FREECIV_HAVE_THREAD_COND
61#define fc_thread_cond char
63#warning FREECIV_HAVE_THREAD_COND defined but we have no real Windows implementation
68#error "No working thread implementation"
void fc_mutex_allocate(fc_mutex *mutex)
void fc_thread_cond_destroy(fc_thread_cond *cond)
void() at_thread_exit_cb(void)
int fc_thread_start(fc_thread *thread, void(*function)(void *arg), void *arg)
void fc_mutex_init(fc_mutex *mutex)
void fc_thread_cond_signal(fc_thread_cond *cond)
void fc_thread_cond_wait(fc_thread_cond *cond, fc_mutex *mutex)
void fc_mutex_release(fc_mutex *mutex)
void fc_thread_wait(fc_thread *thread)
fc_thread_id fc_thread_self(void)
bool has_thread_cond_impl(void)
bool register_at_thread_exit_callback(at_thread_exit_cb *cb)
void fc_thread_cond_init(fc_thread_cond *cond)
bool fc_threads_equal(fc_thread_id thr1, fc_thread_id thr2)
void fc_mutex_destroy(fc_mutex *mutex)