summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-03-02 09:37:56 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-03-02 09:37:56 +0100
commit9f5397b51006f7918c07217b98e91ced547eb6f6 (patch)
tree6a873b30ef5f801b44b35b02e04d83734534c8c3 /eit.c
parent90af5a1bd94255222debf6c05ee159e2ca044680 (diff)
downloadvdr-9f5397b51006f7918c07217b98e91ced547eb6f6.tar.gz
vdr-9f5397b51006f7918c07217b98e91ced547eb6f6.tar.bz2
Fixed a deadlock when switching channels via Schedule/Now|Next/Switch
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/eit.c b/eit.c
index 8f4c0372..9985fbbd 100644
--- a/eit.c
+++ b/eit.c
@@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: eit.c 1.38 2002/02/25 16:30:42 kls Exp $
+ * $Id: eit.c 1.39 2002/03/01 16:32:11 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -1047,8 +1047,6 @@ const char *cSIProcessor::GetEpgDataFileName(void)
void cSIProcessor::SetStatus(bool On)
{
- LOCK_THREAD;
- schedulesMutex.Lock();
ShutDownFilters();
if (On)
{
@@ -1061,7 +1059,6 @@ void cSIProcessor::SetStatus(bool On)
AddFilter(0x12, 0x51); // event info, actual TS, schedule for another 4 days
AddFilter(0x12, 0x61); // event info, other TS, schedule for another 4 days
}
- schedulesMutex.Unlock();
}
/** use the vbi device to parse all relevant SI
@@ -1085,20 +1082,15 @@ void cSIProcessor::Action()
struct tm *ptm = localtime_r(&now, &tm_r);
if (now - lastCleanup > 3600 && ptm->tm_hour == 5)
{
- LOCK_THREAD;
-
- schedulesMutex.Lock();
+ cMutexLock MutexLock(&schedulesMutex);
isyslog(LOG_INFO, "cleaning up schedules data");
schedules->Cleanup();
- schedulesMutex.Unlock();
lastCleanup = now;
ReportEpgBugFixStats(true);
}
if (epgDataFileName && now - lastDump > 600)
{
- LOCK_THREAD;
-
- schedulesMutex.Lock();
+ cMutexLock MutexLock(&schedulesMutex);
FILE *f = fopen(GetEpgDataFileName(), "w");
if (f) {
schedules->Dump(f);
@@ -1107,7 +1099,6 @@ void cSIProcessor::Action()
else
LOG_ERROR;
lastDump = now;
- schedulesMutex.Unlock();
}
}
@@ -1162,12 +1153,9 @@ void cSIProcessor::Action()
case 0x12:
if (buf[0] != 0x72)
{
- LOCK_THREAD;
-
- schedulesMutex.Lock();
+ cMutexLock MutexLock(&schedulesMutex);
cEIT ceit(buf, seclen, schedules);
ceit.ProcessEIT(buf);
- schedulesMutex.Unlock();
}
else
dsyslog(LOG_INFO, "Received stuffing section in EIT\n");
@@ -1261,6 +1249,6 @@ bool cSIProcessor::ShutDownFilters(void)
/** */
bool cSIProcessor::SetCurrentServiceID(unsigned short servid)
{
- LOCK_THREAD;
+ cMutexLock MutexLock(&schedulesMutex);
return schedules ? schedules->SetCurrentServiceID(servid) : false;
}