about summary refs log tree commit diff stats
path: root/src/profanity.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/profanity.c')
-rw-r--r--src/profanity.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/profanity.c b/src/profanity.c
index 1140594f..9e27b6e8 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -323,6 +323,11 @@ _init(char *log_level)
     signal(SIGINT, SIG_IGN);
     signal(SIGTSTP, SIG_IGN);
     signal(SIGWINCH, ui_sigwinch_handler);
+    if (pthread_mutex_init(&lock, NULL) != 0) {
+        log_error("Mutex init failed");
+        exit(1);
+    }
+    pthread_mutex_lock(&lock);
     _create_directories();
     log_level_t prof_log_level = log_level_from_string(log_level);
     prefs_load();