https://bugs.kde.org/show_bug.cgi?id=500951
--- Comment #7 from Jona Wagner <j...@jonawagner.me> --- After fixing a few typos (mutex null pointer resulting in crash and comparing a function pointer instead of the function return value resulting in an always true condition) ``` diff --git a/src/dw/dw_common.c b/src/dw/dw_common.c index 8d49cc5b..24a06d13 100644 --- a/src/dw/dw_common.c +++ b/src/dw/dw_common.c @@ -560,7 +560,7 @@ dw_stabilized_buses_bs(Bit_Set_256 bs_prior, bool some_displays_disconnected) { } -GMutex * active_callback_threads_mutex; +GMutex active_callback_threads_mutex; GHashTable * active_callback_threads; @@ -568,11 +568,11 @@ void record_active_callback_thread(GThread* pthread){ bool debug = false; DBGTRC_STARTING(debug,TRACE_GROUP, "pthread=p", pthread); - g_mutex_lock(active_callback_threads_mutex); + g_mutex_lock(&active_callback_threads_mutex); if (!active_callback_threads) active_callback_threads = g_hash_table_new(g_direct_hash, g_direct_equal); g_hash_table_add(active_callback_threads, pthread); - g_mutex_unlock(active_callback_threads_mutex); + g_mutex_unlock(&active_callback_threads_mutex); DBGTRC_DONE(debug, TRACE_GROUP, "pthread=%p"); } diff --git a/src/libmain/api_displays.c b/src/libmain/api_displays.c index 36d8eed9..9a85669a 100644 --- a/src/libmain/api_displays.c +++ b/src/libmain/api_displays.c @@ -451,7 +451,7 @@ ddca_redetect_displays() { API_PROLOGX(debug, NORESPECT_QUIESCE, ""); DDCA_Status ddcrc = 0; #ifdef WATCH_DISPLAYS - if (active_callback_thread_ct > 0) { + if (active_callback_thread_ct() > 0) { SYSLOG2(DDCA_SYSLOG_ERROR, "Attempting to call when callback threads are active"); ddcrc = DDCRC_INVALID_OPERATION; } ``` the deadlock still occurs. should be noted however that before I fixed the `active_callback_thread_ct` typo that it did not deadlock. since the log is too large for KDE bugtracker I uploaded it to pastebin: https://pastebin.com/raw/aa7kbZvN -- You are receiving this mail because: You are watching all bug changes.