summaryrefslogtreecommitdiff
path: root/pages/schedule.ecpp
diff options
context:
space:
mode:
authorJasmin Jessich <jasmin@anw.at>2017-06-07 00:24:12 +0200
committerJasmin Jessich <jasmin@anw.at>2017-06-07 00:31:50 +0200
commitc60d14e39aa436c4f48d7b7ebbc1d31fee4f8bfd (patch)
tree526c27afc8dd1a855625feb1bd57aa3949824bc8 /pages/schedule.ecpp
parent99cdbf4826724c4952c6cc89ab98bb3083ffb9ce (diff)
downloadvdr-plugin-live-c60d14e39aa436c4f48d7b7ebbc1d31fee4f8bfd.tar.gz
vdr-plugin-live-c60d14e39aa436c4f48d7b7ebbc1d31fee4f8bfd.tar.bz2
Fixed lock order in multischedule.ecpp and schedule.ecpp
- Move the lockings into some blocks and execute other modules with unlocked Channels and Schedules lists. This might not perfect, but there is currently no other solution possible.
Diffstat (limited to 'pages/schedule.ecpp')
-rw-r--r--pages/schedule.ecpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp
index 71b62a0..7321f3c 100644
--- a/pages/schedule.ecpp
+++ b/pages/schedule.ecpp
@@ -25,10 +25,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<%cpp>
pageTitle = trVDR("Schedule");
-#if VDRVERSNUM >= 20301
- // we lock here only the channels on purpose
- LOCK_CHANNELS_READ;
-#else
+#if VDRVERSNUM < 20301
cSchedulesLock schedulesLock;
cSchedules const* schedules = cSchedules::Schedules( schedulesLock );
@@ -40,12 +37,16 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
// cChannel* Channel; (see %request above)
if ( channel > 0 ) {
#if VDRVERSNUM >= 20301
+ LOCK_CHANNELS_READ;
Channel = (cChannel *)Channels->GetByNumber( channel );
#else
Channel = Channels.GetByNumber( channel );
#endif
}
else {
+#if VDRVERSNUM >= 20301
+ LOCK_CHANNELS_READ;
+#endif
if (cDevice::CurrentChannel()) {
#if VDRVERSNUM >= 20301
Channel = (cChannel *)Channels->GetByNumber(cDevice::CurrentChannel());
@@ -64,11 +65,14 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
if ( Channel == 0 )
throw HtmlError( tr("Couldn't find channel or no channels available. Maybe you mistyped your request?") );
+ cSchedule const* Schedule;
#if VDRVERSNUM >= 20301
- LOCK_SCHEDULES_READ;
- cSchedule const* Schedule = Schedules->GetSchedule( (const cChannel *)Channel );
+ {
+ LOCK_SCHEDULES_READ;
+ Schedule = Schedules->GetSchedule( (const cChannel *)Channel );
+ }
#else
- cSchedule const* Schedule = schedules->GetSchedule( Channel );
+ Schedule = schedules->GetSchedule( Channel );
#endif
</%cpp>
<& pageelems.doc_type &>