21 #ifndef THREADENGINE_PTHREAD_H
22 #define THREADENGINE_PTHREAD_H
55 void Start(
Thread* thread_to_init);
62 return "posix-thread";
70 void FreeThread(
Thread* toFree);
84 pthread_mutex_t putex;
90 pthread_mutex_init(&putex, NULL);
96 pthread_mutex_lock(&putex);
102 pthread_mutex_unlock(&putex);
108 pthread_mutex_destroy(&putex);
114 pthread_mutex_t mutex;
119 pthread_mutex_init(&mutex, NULL);
120 pthread_cond_init(&cond, NULL);
125 pthread_mutex_destroy(&mutex);
126 pthread_cond_destroy(&cond);
131 pthread_mutex_lock(&mutex);
136 pthread_mutex_unlock(&mutex);
141 pthread_cond_signal(&cond);
146 pthread_cond_wait(&cond, &mutex);