The mode thread will not be joined multiple times as this causes segfaults under musl
1 files changed, 5 insertions(+), 1 deletions(-)

M src/wofi.c
M src/wofi.c +5 -1
@@ 103,6 103,7 @@ static uint32_t line_count = 0;
 static bool dynamic_lines;
 static struct wl_list mode_list;
 static pthread_t mode_thread;
+static bool has_joined_mode = false;
 
 static struct map* keys;
 

          
@@ 596,7 597,10 @@ static gboolean _insert_widget(gpointer 
 }
 
 static gboolean insert_all_widgets(gpointer data) {
-	pthread_join(mode_thread, NULL);
+	if(!has_joined_mode) {
+		pthread_join(mode_thread, NULL);
+		has_joined_mode = true;
+	}
 	struct wl_list* modes = data;
 	if(modes->prev == modes) {
 		return FALSE;