From 0ffad4dc4e17c9f46b5e7fddff1270cbf9843d49 Mon Sep 17 00:00:00 2001 From: Matt Filetto Date: Fri, 15 Nov 2019 21:13:03 -0800 Subject: [PATCH] Fix git (#278) * presets: remove problematic community presets * Breaks a lot of things including test apps and kodi addon. Link is provided in README.md for those who want it Signed-off-by: Matt Filetto * fix for freeze (issue 243) (#276) --- src/libprojectM/BackgroundWorker.h | 8 +++++++- src/libprojectM/projectM.cpp | 6 +----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libprojectM/BackgroundWorker.h b/src/libprojectM/BackgroundWorker.h index 7f39ff836..892a29873 100644 --- a/src/libprojectM/BackgroundWorker.h +++ b/src/libprojectM/BackgroundWorker.h @@ -26,6 +26,12 @@ public: pthread_cond_init(&condition_work_done, NULL); } + void reset() + { + there_is_work_to_do = false; + finished = false; + } + // called by foreground void wake_up_bg() { @@ -44,7 +50,7 @@ public: pthread_mutex_unlock(&mutex); } - // called by foreground() + // called by foreground() when shutting down, background thread should exit void finish_up() { pthread_mutex_lock(&mutex); diff --git a/src/libprojectM/projectM.cpp b/src/libprojectM/projectM.cpp index fcda10c7e..40b3616e5 100755 --- a/src/libprojectM/projectM.cpp +++ b/src/libprojectM/projectM.cpp @@ -71,16 +71,11 @@ projectM::~projectM() { #ifdef USE_THREADS void *status; - std::cout << "[projectM] thread "; - printf("cl"); worker_sync.finish_up(); - printf("e"); pthread_join(thread, &status); - printf("n"); #ifdef SYNC_PRESET_SWITCHES pthread_mutex_destroy( &preset_mutex ); #endif - printf("up"); std::cout << std::endl; #endif destroyPresetTools(); @@ -567,6 +562,7 @@ void projectM::projectM_init ( int gx, int gy, int fps, int texsize, int width, pthread_mutex_init(&preset_mutex, NULL); #endif + worker_sync.reset(); if (pthread_create(&thread, NULL, thread_callback, this) != 0) {