diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-08-24 14:00:28 +0200 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-08-24 14:00:28 +0200 |
commit | 36a1702cb9b22a91dec25844bbb9674cc7e01087 (patch) | |
tree | 3a2a32e43c807ef893a2741ffeab3da5401a97a8 /searchtimer_thread.c | |
parent | c710608b32f65500d70620275db178834bec1a1f (diff) | |
download | vdr-plugin-epgsearch-36a1702cb9b22a91dec25844bbb9674cc7e01087.tar.gz vdr-plugin-epgsearch-36a1702cb9b22a91dec25844bbb9674cc7e01087.tar.bz2 |
moved from cCondWait::SleepMs to cCondWait::Wait to avoid shutdown problems, patch by
e9hack
Diffstat (limited to 'searchtimer_thread.c')
-rw-r--r-- | searchtimer_thread.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/searchtimer_thread.c b/searchtimer_thread.c index 5940603..a8ed791 100644 --- a/searchtimer_thread.c +++ b/searchtimer_thread.c @@ -91,6 +91,7 @@ void cSearchTimerThread::Exit(void) { void cSearchTimerThread::Stop(void) { m_Active = false; + Wait.Signal(); Cancel(6); } @@ -198,7 +199,7 @@ void cSearchTimerThread::Action(void) m_Active = true; // let VDR do its startup for(int wait = 0; wait < SEARCHTIMER_WAIT && m_Active; wait++) - sleepSec(1); + Wait.Wait(1000); time_t nextUpdate = time(NULL); while (m_Active) @@ -209,7 +210,7 @@ void cSearchTimerThread::Action(void) { if (Timers.BeingEdited()) { - sleepSec(1); + Wait.Wait(1000); continue; } LogFile.iSysLog("search timer update started"); @@ -524,9 +525,10 @@ void cSearchTimerThread::Action(void) m_lastUpdate = time(NULL); nextUpdate = long(m_lastUpdate/60)*60 + (EPGSearchConfig.UpdateIntervall * 60); } - sleepSec(2); // to avoid high system load if time%30==0 + if (m_Active) + Wait.Wait(2000); // to avoid high system load if time%30==0 while (m_Active && !NeedUpdate() && time(NULL)%30 != 0) // sync heart beat to a multiple of 5secs - sleepSec(1); + Wait.Wait(1000); }; LogFile.iSysLog("Leaving search timer thread"); } |