summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.c b/main.c
index 5a1916e..4eb4cf7 100644
--- a/main.c
+++ b/main.c
@@ -7,6 +7,7 @@
#include "version.h"
#include "midi.h"
#include "synth.h"
+#include "mutex.h"
void help(const char *argv0) {
printf("Usage: %s [options]\n"
@@ -70,6 +71,9 @@ int main(int argc, char *argv[]) {
fprintf(stdout, "> Device port: %s\n", port_name);
fprintf(stdout, "> Soundfont: %s\n", soundfont_file);
+ // Create mutex.
+ initialize_mutex();
+
// Create synth thread.
pthread_t synth_thread;
SynthArgs synth_args = { soundfont_file };
@@ -91,6 +95,9 @@ int main(int argc, char *argv[]) {
pthread_join(midi_thread, NULL);
pthread_join(synth_thread, NULL);
+ // Destroy mutex.
+ destroy_mutex();
+
fprintf(stdout, "Exiting...\n");
return 0;
}