diff options
Diffstat (limited to 'mutex.c')
| -rw-r--r-- | mutex.c | 19 |
1 files changed, 19 insertions, 0 deletions
| @@ -0,0 +1,19 @@ | |||
| 1 | #include <pthread.h> | ||
| 2 | #include "mutex.h" | ||
| 3 | |||
| 4 | SharedData shared_data; | ||
| 5 | |||
| 6 | pthread_mutex_t mutex; | ||
| 7 | pthread_cond_t cond_midi; | ||
| 8 | pthread_cond_t cond_synth; | ||
| 9 | |||
| 10 | void initialize_mutex() { | ||
| 11 | pthread_mutex_init(&mutex, NULL); | ||
| 12 | pthread_cond_init(&cond_synth, NULL); | ||
| 13 | } | ||
| 14 | |||
| 15 | void destroy_mutex() { | ||
| 16 | pthread_mutex_destroy(&mutex); | ||
| 17 | pthread_cond_destroy(&cond_synth); | ||
| 18 | } | ||
| 19 | |||
