summaryrefslogtreecommitdiff
path: root/mutex.c
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-10-09 17:59:41 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-10-09 17:59:41 +0200
commitbfc79cef2cb743fedba3e93fd005d25b0a4923dc (patch)
treeba322aea6b9ce203b9daf9b4b7b9280455027454 /mutex.c
parentcf2cfcd8a96921dbe812647045dff71ab63989cd (diff)
downloadttdaw-bfc79cef2cb743fedba3e93fd005d25b0a4923dc.tar.gz
Added mutex and proper audio playback
Diffstat (limited to 'mutex.c')
-rw-r--r--mutex.c19
1 files changed, 19 insertions, 0 deletions
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 <pthread.h>
+#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);
+}
+