Skip to content

Commit 0ffad4d

Browse files
Albinoman887revmischa
authored andcommitted
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 <[email protected]> * fix for freeze (issue 243) (#276)
1 parent 9ea9a7c commit 0ffad4d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/libprojectM/BackgroundWorker.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ class BackgroundWorkerSync
2626
pthread_cond_init(&condition_work_done, NULL);
2727
}
2828

29+
void reset()
30+
{
31+
there_is_work_to_do = false;
32+
finished = false;
33+
}
34+
2935
// called by foreground
3036
void wake_up_bg()
3137
{
@@ -44,7 +50,7 @@ class BackgroundWorkerSync
4450
pthread_mutex_unlock(&mutex);
4551
}
4652

47-
// called by foreground()
53+
// called by foreground() when shutting down, background thread should exit
4854
void finish_up()
4955
{
5056
pthread_mutex_lock(&mutex);

src/libprojectM/projectM.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,11 @@ projectM::~projectM()
7171
{
7272
#ifdef USE_THREADS
7373
void *status;
74-
std::cout << "[projectM] thread ";
75-
printf("cl");
7674
worker_sync.finish_up();
77-
printf("e");
7875
pthread_join(thread, &status);
79-
printf("n");
8076
#ifdef SYNC_PRESET_SWITCHES
8177
pthread_mutex_destroy( &preset_mutex );
8278
#endif
83-
printf("up");
8479
std::cout << std::endl;
8580
#endif
8681
destroyPresetTools();
@@ -567,6 +562,7 @@ void projectM::projectM_init ( int gx, int gy, int fps, int texsize, int width,
567562
pthread_mutex_init(&preset_mutex, NULL);
568563
#endif
569564

565+
worker_sync.reset();
570566
if (pthread_create(&thread, NULL, thread_callback, this) != 0)
571567
{
572568

0 commit comments

Comments
 (0)