diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-07-05 16:24:04 +0200 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-07-05 16:44:38 +0200 |
commit | e96911dfac925247c4f70e50fa96c4741ab01e67 (patch) | |
tree | 5565bf422b826981b75e9a86fa7814e625759211 | |
parent | ebd63f9a42ebf2024f326ff506c009d13446bca5 (diff) | |
download | vdr-plugin-tvguideng-e96911dfac925247c4f70e50fa96c4741ab01e67.tar.gz vdr-plugin-tvguideng-e96911dfac925247c4f70e50fa96c4741ab01e67.tar.bz2 |
Fixed invalid lock sequence reports
-rw-r--r-- | channelepg.c | 21 | ||||
-rw-r--r-- | epggrid.c | 30 |
2 files changed, 36 insertions, 15 deletions
diff --git a/channelepg.c b/channelepg.c index 3ca9173..b5af13c 100644 --- a/channelepg.c +++ b/channelepg.c @@ -22,12 +22,15 @@ bool cChannelEpg::ReadGrids(void) { const cSchedule *Schedule = NULL; + const cSchedules* schedules; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_SCHEDULES_READ; - const cSchedules* schedules = Schedules; + schedules = Schedules; + } #else cSchedulesLock schedulesLock; - const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock); + schedules = (cSchedules*)cSchedules::Schedules(schedulesLock); #endif if (!schedules) return false; @@ -171,12 +174,15 @@ void cChannelEpg::AddNewGridsAtStart(void) { return; } //if not, i have to add new ones to the list + const cSchedules* schedules; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_SCHEDULES_READ; - const cSchedules* schedules = Schedules; + schedules = Schedules; + } #else cSchedulesLock schedulesLock; - const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock); + schedules = (cSchedules*)cSchedules::Schedules(schedulesLock); #endif if (!schedules) return ; @@ -225,12 +231,15 @@ void cChannelEpg::AddNewGridsAtEnd(void) { return; } //if not, i have to add new ones to the list + const cSchedules* schedules; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_SCHEDULES_READ; - const cSchedules* schedules = Schedules; + schedules = Schedules; + } #else cSchedulesLock schedulesLock; - const cSchedules* schedules = (cSchedules*)cSchedules::Schedules(schedulesLock); + schedules = (cSchedules*)cSchedules::Schedules(schedulesLock); #endif if (!schedules) return ; @@ -57,11 +57,14 @@ void cEpgGrid::Init(const cChannel *startChannel) { int numBack = channelsPerPage / 2; int offset = 0; const cChannel *newStartChannel = startChannel; + const cChannels* channels; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_CHANNELS_READ; - const cChannels* channels = Channels; + channels = Channels; + } #else - const cChannels* channels = &Channels; + channels = &Channels; #endif for (; newStartChannel ; newStartChannel = channels->Prev(newStartChannel)) { @@ -87,11 +90,14 @@ void cEpgGrid::CreateChannels(const cChannel *startChannel, int activeChannel) { if (!startChannel) return; + const cChannels* chls; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) - LOCK_CHANNELS_READ; - const cChannels* chls = Channels; + { + LOCK_CHANNELS_READ; + chls = Channels; + } #else - cChannels* chls = &Channels; + chls = &Channels; #endif for (const cChannel *channel = startChannel; channel; channel = chls->Next(channel)) { @@ -269,11 +275,14 @@ bool cEpgGrid::ChannelForward(void) { //insert new channels at end int numInserted = 0; + const cChannels* chls; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_CHANNELS_READ; - const cChannels* chls = Channels; + chls = Channels; + } #else - const cChannels* chls = &Channels; + chls = &Channels; #endif for (const cChannel *channel = (const cChannel*)currentChannel->Next(); channel ; channel = chls->Next(channel)) { @@ -335,11 +344,14 @@ bool cEpgGrid::ChannelBack(void) { return false; //insert new channels at start int numInserted = 0; + const cChannels* chls; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_CHANNELS_READ; - const cChannels* chls = Channels; + chls = Channels; + } #else - const cChannels* chls = &Channels; + chls = &Channels; #endif for (const cChannel *channel = (const cChannel*)currentChannel->Prev(); channel ; channel = chls->Prev(channel)) { if (channel->GroupSep()) { |