diff options
author | Jasmin Jessich <jasmin@anw.at> | 2017-06-24 01:34:33 +0200 |
---|---|---|
committer | Jasmin Jessich <jasmin@anw.at> | 2017-06-24 01:41:56 +0200 |
commit | 203895d72ea0d5858685e324faeafb3050b2c177 (patch) | |
tree | 30dacceaa5980c7e928cddf8102fa82aa474cbf2 /pages | |
parent | 5cb665d2718b0e5f950b5796c70d92aaffa60b9f (diff) | |
download | vdr-plugin-live-203895d72ea0d5858685e324faeafb3050b2c177.tar.gz vdr-plugin-live-203895d72ea0d5858685e324faeafb3050b2c177.tar.bz2 |
Fixed lock order in remote.ecpp
- Move the top LOCK_CHANNELS_READ into the blocks and use several
lock statements.
Diffstat (limited to 'pages')
-rw-r--r-- | pages/remote.ecpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pages/remote.ecpp b/pages/remote.ecpp index 0c46f69..7c43268 100644 --- a/pages/remote.ecpp +++ b/pages/remote.ecpp @@ -28,9 +28,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); pageTitle = tr("Remote Control"); -#if VDRVERSNUM >= 20301 - LOCK_CHANNELS_READ; -#else +#if VDRVERSNUM < 20301 ReadLock channelsLock( Channels ); if ( !channelsLock ) throw HtmlError( tr("Couldn't aquire access to channels, please try again later.") ); @@ -39,6 +37,7 @@ 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 ); @@ -47,6 +46,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); else { if (cDevice::CurrentChannel()) { #if VDRVERSNUM >= 20301 + LOCK_CHANNELS_READ; Channel = (cChannel *)Channels->GetByNumber(cDevice::CurrentChannel()); #else Channel = Channels.GetByNumber(cDevice::CurrentChannel()); @@ -54,6 +54,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } else { #if VDRVERSNUM >= 20301 + LOCK_CHANNELS_READ; Channel = (cChannel *)Channels->Get( Channels->GetNextNormal( -1 ) ); #else Channel = Channels.Get( Channels.GetNextNormal( -1 ) ); |