From bfc79cef2cb743fedba3e93fd005d25b0a4923dc Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 9 Oct 2024 17:59:41 +0200 Subject: Added mutex and proper audio playback --- mutex.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 mutex.c (limited to 'mutex.c') diff --git a/mutex.c b/mutex.c new file mode 100644 index 0000000..007928d --- /dev/null +++ b/mutex.c @@ -0,0 +1,19 @@ +#include +#include "mutex.h" + +SharedData shared_data; + +pthread_mutex_t mutex; +pthread_cond_t cond_midi; +pthread_cond_t cond_synth; + +void initialize_mutex() { + pthread_mutex_init(&mutex, NULL); + pthread_cond_init(&cond_synth, NULL); +} + +void destroy_mutex() { + pthread_mutex_destroy(&mutex); + pthread_cond_destroy(&cond_synth); +} + -- cgit v1.2.3