summaryrefslogtreecommitdiff
path: root/eit2.c
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2019-07-04 09:58:14 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2019-07-04 09:58:14 (GMT)
commit32b4e669bf8bc6e3336073616c121f10b8518fe8 (patch)
tree9ed7a97976e673e41b98ee79ca68df1ffed4a5f6 /eit2.c
parentc46be443988489780f993a47d23a42936b49d6c0 (diff)
downloadvdr-plugin-eepg-master.tar.gz
vdr-plugin-eepg-master.tar.bz2
applied patch from cheesemonster to fix multiple tuners deadlock #2586HEADmasterexperimental
Diffstat (limited to 'eit2.c')
-rw-r--r--eit2.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/eit2.c b/eit2.c
index 5aeb60d..9ee190d 100644
--- a/eit2.c
+++ b/eit2.c
@@ -491,13 +491,16 @@ cEIT2::cEIT2 (int Source, u_char Tid, const u_char * Data, EFormat format, bool
//LogD(5, prep("channelID: %s format:%d"), *channel->GetChannelID().ToString(), Format);
#if APIVERSNUM >= 20300
- LOCK_CHANNELS_WRITE;
+ cStateKey ChannelsStateKey;
+ cChannels *Channels = cChannels::GetChannelsWrite(ChannelsStateKey, 10);
if (!Channels) {
LogD(3, prep("Error obtaining channels lock"));
return;
}
- LOCK_SCHEDULES_WRITE;
+ cStateKey SchedulesStateKey;
+ cSchedules *Schedules = cSchedules::GetSchedulesWrite(SchedulesStateKey, 10);
if (!Schedules) {
+ ChannelsStateKey.Remove(false);
LogD(3, prep("Error obtaining schedules lock"));
return;
}
@@ -622,6 +625,8 @@ cEIT2::cEIT2 (int Source, u_char Tid, const u_char * Data, EFormat format, bool
if (Tid == 0x4E)
pSchedule->SetPresentSeen ();
if (OnlyRunningStatus) {
+ SchedulesStateKey.Remove(false);
+ ChannelsStateKey.Remove(false);
LogD(4, prep("OnlyRunningStatus"));
return;
}
@@ -630,6 +635,8 @@ cEIT2::cEIT2 (int Source, u_char Tid, const u_char * Data, EFormat format, bool
pSchedule->DropOutdated (SegmentStart, SegmentEnd, Tid, getVersionNumber ());
sortSchedules(Schedules, channel->GetChannelID());
}
+ SchedulesStateKey.Remove(Modified);
+ ChannelsStateKey.Remove(Modified);
LogD(4, prep("end of cEIT2"));
}