summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--HISTORY.DE2
-rw-r--r--conflictcheck_thread.c25
-rw-r--r--conflictcheck_thread.h1
-rw-r--r--epgsearch.c2
-rw-r--r--searchtimer_thread.c10
-rw-r--r--searchtimer_thread.h1
-rw-r--r--switchtimer_thread.c13
-rw-r--r--switchtimer_thread.h1
9 files changed, 36 insertions, 21 deletions
diff --git a/HISTORY b/HISTORY
index ba70ca0..10ef7de 100644
--- a/HISTORY
+++ b/HISTORY
@@ -16,6 +16,8 @@ fixes:
to egal@vdrportal
- when an incomplete recording triggers a search timer update for a search timer
with 'avoid repeats' now running events are ignored for the repeats.
+- now using cCondWait::Wait instead of cCondWait:SleepMs to avoid shutdown problems,
+ thanks to e9hack@vdrportal for providing a patch
2008-04-29: Version 0.9.24
new:
diff --git a/HISTORY.DE b/HISTORY.DE
index 3458a0d..41ad0e2 100644
--- a/HISTORY.DE
+++ b/HISTORY.DE
@@ -17,6 +17,8 @@ fixes:
- Wenn eine unvollständige Aufnahme ein Suchtimer-Update für einen Suchtimer mit
'Wiederholung vermeiden' auslöst, werden nun bereits laufende Sendungen als Wieder-
holung ignoriert.
+- Es wird nun cCondWait::Wait anstelle von cCondWait:SleepMs verwendet um Probleme beim
+ Beenden zu vermeiden, danke e9hack@vdrportal für den Patch
2008-04-29: Version 0.9.24
diff --git a/conflictcheck_thread.c b/conflictcheck_thread.c
index 8d323f5..05426dc 100644
--- a/conflictcheck_thread.c
+++ b/conflictcheck_thread.c
@@ -77,6 +77,7 @@ void cConflictCheckThread::Exit(void) {
void cConflictCheckThread::Stop(void) {
m_Active = false;
+ Wait.Signal();
Cancel(6);
}
@@ -86,9 +87,9 @@ void cConflictCheckThread::Action(void)
m_Active = true;
// let VDR do its startup
- if (!m_runOnce)
+ if (!m_runOnce)
for(int wait = 0; wait < CONFLCHECK_WAIT && m_Active; wait++)
- sleepSec(1);
+ Wait.Wait(1000);
time_t nextUpdate = time(NULL);
while (m_Active)
@@ -96,16 +97,16 @@ void cConflictCheckThread::Action(void)
time_t now = time(NULL);
if (now >= nextUpdate || m_forceUpdate)
{
- m_forceUpdate = false;
- if (Timers.BeingEdited())
+ m_forceUpdate = false;
+ if (Timers.BeingEdited())
{
- sleepSec(1);
+ Wait.Wait(1000);
continue;
}
LogFile.iSysLog("timer conflict check started");
- cConflictCheck conflictCheck;
- conflictCheck.Check();
+ cConflictCheck conflictCheck;
+ conflictCheck.Check();
time_t nextConflict = 0;
if (conflictCheck.relevantConflicts > 0)
@@ -138,18 +139,20 @@ void cConflictCheckThread::Action(void)
m_lastUpdate = time(NULL);
int Intervall = EPGSearchConfig.conflictCheckIntervall;
- if (nextConflict > 0 && EPGSearchConfig.conflictCheckWithinLimit > 0 &&
+ if (nextConflict > 0 && EPGSearchConfig.conflictCheckWithinLimit > 0 &&
nextConflict - time(NULL) < EPGSearchConfig.conflictCheckWithinLimit * 60)
Intervall = EPGSearchConfig.conflictCheckIntervall2;
nextUpdate = long(m_lastUpdate/60)*60 + (Intervall * 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 ?????????????????????
+ // no waiting in the while loop if m_runOnce is true
while (m_Active && time(NULL)%30 != 0 && !m_runOnce) // sync heart beat to a multiple of 5secs
- sleepSec(1);
+ Wait.Wait(1000);
};
- m_Active = false;
+ m_Active = false; // always false at this point
LogFile.iSysLog("Leaving conflict check thread");
}
diff --git a/conflictcheck_thread.h b/conflictcheck_thread.h
index 667045e..62ec9d2 100644
--- a/conflictcheck_thread.h
+++ b/conflictcheck_thread.h
@@ -35,6 +35,7 @@ class cConflictCheckThread: public cThread {
cPluginEpgsearch* m_plugin;
static bool m_runOnce;
static bool m_forceUpdate;
+ cCondWait Wait;
protected:
virtual void Action(void);
void Stop(void);
diff --git a/epgsearch.c b/epgsearch.c
index ad63fad..bcc6b9c 100644
--- a/epgsearch.c
+++ b/epgsearch.c
@@ -69,7 +69,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
#include <langinfo.h>
#endif
-static const char VERSION[] = "0.9.25.beta2";
+static const char VERSION[] = "0.9.25.beta3";
static const char DESCRIPTION[] = trNOOP("search the EPG for repeats and more");
// globals
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");
}
diff --git a/searchtimer_thread.h b/searchtimer_thread.h
index ddd42ee..7c0782e 100644
--- a/searchtimer_thread.h
+++ b/searchtimer_thread.h
@@ -48,6 +48,7 @@ class cSearchTimerThread: public cThread {
time_t m_lastUpdate;
cPluginEpgsearch* m_plugin;
cMailUpdateNotifier mailNotifier;
+ cCondWait Wait;
protected:
virtual void Action(void);
diff --git a/switchtimer_thread.c b/switchtimer_thread.c
index d1bf9ec..7f6388f 100644
--- a/switchtimer_thread.c
+++ b/switchtimer_thread.c
@@ -60,6 +60,7 @@ void cSwitchTimerThread::Exit(void) {
void cSwitchTimerThread::Stop(void) {
m_Active = false;
+ Wait.Signal();
Cancel(6);
}
@@ -69,7 +70,7 @@ void cSwitchTimerThread::Action(void)
// let VDR do its startup
for(int wait = 0; wait < SWITCHTIMER_WAIT && m_Active; wait++)
- sleepSec(1);
+ Wait.Wait(1000);
time_t nextUpdate = time(NULL);
while (m_Active)
@@ -104,7 +105,8 @@ void cSwitchTimerThread::Action(void)
cString Message = cString::sprintf("%s: %s - %s", event->Title(),
CHANNELNAME(channel), GETTIMESTRING(event));
SendMsg(Message);
- sleepSec(MSG_DELAY);
+ if (m_Active)
+ Wait.Wait(1000 * MSG_DELAY);
}
SwitchTimers.Save();
break;
@@ -112,15 +114,16 @@ void cSwitchTimerThread::Action(void)
switchTimer = SwitchTimers.Next(switchTimer);
}
LogFile.Log(3,"switch timer check finished");
- sleepSec(MSG_DELAY);
+ if (m_Active)
+ Wait.Wait(1000 * MSG_DELAY);
m_lastUpdate = time(NULL);
nextUpdate = long(m_lastUpdate/60)*60+ 60 - MSG_DELAY ; // check at each full minute minus 5sec
if (SwitchTimers.Count() == 0)
m_Active = false;
}
while (m_Active && time(NULL)%MSG_DELAY != 0) // sync heart beat to MSG_DELAY
- sleepSec(1);
- sleepSec(1);
+ Wait.Wait(1000);
+ Wait.Wait(1000);
};
m_Instance = NULL;
}
diff --git a/switchtimer_thread.h b/switchtimer_thread.h
index 5f2abbf..115ff0b 100644
--- a/switchtimer_thread.h
+++ b/switchtimer_thread.h
@@ -31,6 +31,7 @@ class cSwitchTimerThread: public cThread {
private:
bool m_Active;
time_t m_lastUpdate;
+ cCondWait Wait;
protected:
virtual void Action(void);
void Stop(void);