Document that SMP is supported from gcc 3.3 onward
[jack_interposer.git] / test_cond_wait_simple.c
blob8e6b1c68c06ab63138f25aa02b83a874f227b44a
1 #include <pthread.h>
2 #include <stdbool.h>
3 #include <stdio.h>
5 pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
6 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
8 bool done = false;
10 void* signaller(void* arg)
12 while(!done)
14 pthread_cond_signal(&cond);
18 int main()
20 pthread_t thread;
21 pthread_create(&thread, NULL, &signaller, NULL);
22 pthread_cond_wait(&cond, &mutex);
23 done = 1;
24 pthread_join(thread, NULL);
25 return 0;