Rework cRecManager::createLocalTimer

This commit is contained in:
kamel5 2019-07-10 14:43:12 +02:00
parent ad1f0ba0d6
commit 549d42b487
1 changed files with 5 additions and 12 deletions

View File

@ -99,10 +99,11 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost)
((cTimer*)timer)->SetRemote(Setup.SVDRPDefaultHost);
LOCK_TIMERS_WRITE;
cTimer *t = Timers->GetTimer(timer);
cTimers* timers = Timers;
#else
cTimer *t = Timers.GetTimer(timer);
cTimers* timers = &Timers;
#endif
cTimer *t = timers->GetTimer(timer);
if (t) {
t->OnOff();
#if VDRVERSNUM >= 20301
@ -114,19 +115,11 @@ cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
timer = t;
isyslog("timer %s reactivated", *t->ToDescr());
} else {
#if VDRVERSNUM >= 20301
Timers->Add(timer);
#else
Timers.Add(timer);
#endif
timers->Add(timer);
isyslog("timer %s added (active)", *timer->ToDescr());
}
SetTimerPath(timer, event, path);
#if VDRVERSNUM >= 20301
Timers->SetModified();
#else
Timers.SetModified();
#endif
timers->SetModified();
return timer;
}