mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
[experimental] gui/components/cc_frm_clock: use a mutex around unsetting/evaluating paintClock. This may or may not help with the clock-still-showing-when-leaving-the-channellist problem. Pretty much untested, as that issue is quite irreproducible.
Origin commit data
------------------
Commit: 1c39a6edf4
Author: martii <m4rtii@gmx.de>
Date: 2014-04-08 (Tue, 08 Apr 2014)
This commit is contained in:
@@ -260,24 +260,14 @@ void* CComponentsFrmClock::initClockThread(void *arg)
|
||||
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0);
|
||||
|
||||
CComponentsFrmClock *clock = static_cast<CComponentsFrmClock*>(arg);
|
||||
#if 0
|
||||
time_t count = time(0);
|
||||
#endif
|
||||
//start loop for paint
|
||||
while(clock != NULL) {
|
||||
if (clock->paintClock) {
|
||||
while (true) {
|
||||
clock->mutex.lock();
|
||||
if (clock->paintClock)
|
||||
clock->paint(CC_SAVE_SCREEN_NO);
|
||||
#if 0
|
||||
count = time(0);
|
||||
#endif
|
||||
}
|
||||
#if 0 // memory leak, thread will not be joined --martii
|
||||
if (time(0) >= count+30) {
|
||||
clock->cl_thread = 0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
mySleep(clock->cl_interval);
|
||||
clock->mutex.unlock();
|
||||
int interval = clock->cl_interval;
|
||||
mySleep(interval);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -336,7 +326,9 @@ bool CComponentsFrmClock::Stop()
|
||||
{
|
||||
if (!activeClock)
|
||||
return false;
|
||||
mutex.lock();
|
||||
paintClock = false;
|
||||
mutex.unlock();
|
||||
return cl_thread == 0 ? false : true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user