From 1572944ecd70e2d3f716084a058218f3e90f241d Mon Sep 17 00:00:00 2001 From: Jasmin Jessich Date: Sun, 14 May 2017 00:52:37 +0200 Subject: Added comments concerning TODOs --- epgsearch.cpp | 5 ++++- epgsearch.h | 4 ++++ pages/schedule.ecpp | 3 +++ pages/timerconflicts.ecpp | 1 + pages/timers.ecpp | 1 + pages/whats_on.ecpp | 1 + timers.cpp | 3 +++ 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/epgsearch.cpp b/epgsearch.cpp index 7e92a10..0b15f10 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -578,10 +578,13 @@ SearchResult::SearchResult( string const& data ) const cEvent* SearchResult::GetEvent() { - cSchedulesLock schedulesLock; + /* JJJ: Lock order wrong, fix if function is still used + * Needs to be Timers, Channels, Recordings Schedules in this sequence + */ #if VDRVERSNUM >= 20301 LOCK_SCHEDULES_READ; #else + cSchedulesLock schedulesLock; const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); #endif if (!Schedules) return NULL; diff --git a/epgsearch.h b/epgsearch.h index 7545b39..61ae2eb 100644 --- a/epgsearch.h +++ b/epgsearch.h @@ -341,6 +341,10 @@ public: int TimerMode() const { return m_timerMode; } bool operator<( SearchResult const& other ) const { return m_starttime < other.m_starttime; } const cEvent* GetEvent(); + + /* JJJ: Should be done with a "Channels" argument to be sure the Lock order + * is correct; or find a better way to do this + */ #if VDRVERSNUM >= 20301 const cChannel* GetChannel() { LOCK_CHANNELS_READ; return Channels->GetByChannelID(m_channel); } #else diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index be09d9d..96d9427 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -32,6 +32,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); pageTitle = trVDR("Schedule"); #if VDRVERSNUM >= 20301 + /* JJJ: Order wrong! Better get first the channel and with unlocked + * channels lock read the schedules + */ LOCK_SCHEDULES_READ; LOCK_CHANNELS_READ; #else diff --git a/pages/timerconflicts.ecpp b/pages/timerconflicts.ecpp index 31f5607..b6c34f0 100644 --- a/pages/timerconflicts.ecpp +++ b/pages/timerconflicts.ecpp @@ -47,6 +47,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <%cpp> #if VDRVERSNUM >= 20301 + /* JJJ: Lock this later when it is realy used */ LOCK_TIMERS_READ; LOCK_SCHEDULES_READ; #endif diff --git a/pages/timers.ecpp b/pages/timers.ecpp index cc2eeb6..9f5632c 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -78,6 +78,7 @@ static const size_t maximumDescriptionLength = 300; <%cpp> // output of the timer list: #if VDRVERSNUM >= 20301 + /* JJJ: Lock this inside the loop */ LOCK_SCHEDULES_READ; #endif for (SortedTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer) { diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index a38faf9..2db13ef 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -39,6 +39,7 @@ 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; diff --git a/timers.cpp b/timers.cpp index 6991e91..01eb2be 100644 --- a/timers.cpp +++ b/timers.cpp @@ -328,6 +328,7 @@ namespace vdrlive { *oldTimer = copy; #if VDRVERSNUM >= 20301 + // JJJ: Warum das? Timers->SetModified(); #else Timers.SetModified(); @@ -366,6 +367,7 @@ namespace vdrlive { } #if VDRVERSNUM >= 20301 Timers->Del( oldTimer ); + // JJJ: Warum das? Timers->SetModified(); #else Timers.Del( oldTimer ); @@ -396,6 +398,7 @@ namespace vdrlive { #if VDRVERSNUM >= 20301 toggleTimer->OnOff(); + // JJJ: Warum das? Timers->SetModified(); #else toggleTimer->OnOff(); -- cgit v1.2.3