aboutsummaryrefslogtreecommitdiff
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 @@
7#include "version.h" 7#include "version.h"
8#include "midi.h" 8#include "midi.h"
9#include "synth.h" 9#include "synth.h"
10#include "mutex.h"
10 11
11void help(const char *argv0) { 12void help(const char *argv0) {
12 printf("Usage: %s [options]\n" 13 printf("Usage: %s [options]\n"
@@ -70,6 +71,9 @@ int main(int argc, char *argv[]) {
70 fprintf(stdout, "> Device port: %s\n", port_name); 71 fprintf(stdout, "> Device port: %s\n", port_name);
71 fprintf(stdout, "> Soundfont: %s\n", soundfont_file); 72 fprintf(stdout, "> Soundfont: %s\n", soundfont_file);
72 73
74 // Create mutex.
75 initialize_mutex();
76
73 // Create synth thread. 77 // Create synth thread.
74 pthread_t synth_thread; 78 pthread_t synth_thread;
75 SynthArgs synth_args = { soundfont_file }; 79 SynthArgs synth_args = { soundfont_file };
@@ -91,6 +95,9 @@ int main(int argc, char *argv[]) {
91 pthread_join(midi_thread, NULL); 95 pthread_join(midi_thread, NULL);
92 pthread_join(synth_thread, NULL); 96 pthread_join(synth_thread, NULL);
93 97
98 // Destroy mutex.
99 destroy_mutex();
100
94 fprintf(stdout, "Exiting...\n"); 101 fprintf(stdout, "Exiting...\n");
95 return 0; 102 return 0;
96} 103}