diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/whats_on.ecpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 36a8f96..444b845 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -38,14 +38,6 @@ string current_displaytime; if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -#if VDRVERSNUM >= 20301 -/* JJJ: Lock this later and in the right order */ -LOCK_SCHEDULES_READ; -#else -cSchedulesLock schedulesLock; -const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); -#endif - string head; time_t seektime = 0; string displaytime; @@ -130,13 +122,12 @@ if (type == "now") { if (type != "favs") { #if VDRVERSNUM >= 20301 - LOCK_CHANNELS_READ; - if (true) { + LOCK_CHANNELS_READ; + { #else ReadLock channelsLock( Channels ); if (channelsLock) { #endif - // int evntNr = 0; #if VDRVERSNUM >= 20301 for (cChannel *Channel = (cChannel *)Channels->First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = (cChannel *)Channels->Next(Channel)) { #else @@ -145,7 +136,18 @@ if (type == "now") { if (Channel->GroupSep()) { continue; } - const cSchedule *Schedule = Schedules->GetSchedule(Channel); + const cSchedule *Schedule; + { +#if VDRVERSNUM >= 20301 + + LOCK_SCHEDULES_READ; +#else + cSchedulesLock schedulesLock; + const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); +#endif + + Schedule = Schedules->GetSchedule(Channel); + } if (!Schedule) { continue; } |