From 5a6118f097716999ae8af42418c2347c510187ed Mon Sep 17 00:00:00 2001 From: Scoopta Date: Fri, 2 Oct 2020 20:54:36 -0700 Subject: [PATCH] The mode thread will not be joined multiple times as this causes segfaults under musl --- src/wofi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wofi.c b/src/wofi.c index 6cb1d4f..0f04156 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -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 data) { } 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;