diff options
author | kamel5 <kamel5 (at) gmx (dot) net> | 2018-05-03 13:42:44 +0200 |
---|---|---|
committer | kamel5 <kamel5 (at) gmx (dot) net> | 2018-05-03 13:42:44 +0200 |
commit | 39dc33f360031e86e4c08f969054f6b555e738ae (patch) | |
tree | 1dffc5ff014b8871da62a431c154cffcf49e3828 | |
parent | 0ae15aebbf31c52fd676e1d68ee45402b857750d (diff) | |
download | skin-nopacity-39dc33f360031e86e4c08f969054f6b555e738ae.tar.gz skin-nopacity-39dc33f360031e86e4c08f969054f6b555e738ae.tar.bz2 |
Do locking for vdr-2.3.x
-rw-r--r-- | displaychannel.c | 3 | ||||
-rw-r--r-- | displaychannelview.c | 10 | ||||
-rw-r--r-- | displaymenu.c | 5 | ||||
-rw-r--r-- | imagecache.c | 3 | ||||
-rw-r--r-- | menudetailview.c | 12 | ||||
-rw-r--r-- | menuitem.c | 12 |
6 files changed, 25 insertions, 20 deletions
diff --git a/displaychannel.c b/displaychannel.c index a30e7fb..e90d180 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -101,7 +101,8 @@ void cNopacityDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Fol } bool recCurrent = false; eTimerMatch TimerMatch = tmNone; - const cTimer *Timer = Timers.GetMatch(Present, &TimerMatch); + LOCK_TIMERS_READ; + const cTimer *Timer = Timers->GetMatch(Present, &TimerMatch); if (Timer && Timer->Recording()) { recCurrent = true; } diff --git a/displaychannelview.c b/displaychannelview.c index a910491..9c6a671 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -779,9 +779,10 @@ void cNopacityDisplayChannelView::DrawChannelGroups(const cChannel *Channel, cSt std::string cNopacityDisplayChannelView::GetChannelSep(const cChannel *channel, bool prev) { std::string sepName = ""; - const cChannel *sep = prev ? Channels.Prev(channel) : - Channels.Next(channel); - for (; sep; (prev)?(sep = Channels.Prev(sep)):(sep = Channels.Next(sep))) { + LOCK_CHANNELS_READ; + const cChannel *sep = prev ? Channels->Prev(channel) : + Channels->Next(channel); + for (; sep; (prev)?(sep = Channels->Prev(sep)):(sep = Channels->Next(sep))) { if (sep->GroupSep()) { sepName = sep->Name(); break; @@ -798,7 +799,8 @@ void cNopacityDisplayChannelView::DrawSourceInfo(void) { channelInfo = cString::sprintf("%s #%d", source->Description(), cDevice::ActualDevice()->DeviceNumber()); } if (cRecordControls::Active()) { - cSortedTimers SortedTimers; + LOCK_TIMERS_READ; + cSortedTimers SortedTimers(Timers); bool first = true; int truncPos = 0; for (int i = 0; i < SortedTimers.Size(); i++) diff --git a/displaymenu.c b/displaymenu.c index 31737e5..319a7a8 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -100,7 +100,8 @@ void cNopacityDisplayMenu::DrawTimers(bool timersChanged, int numConflicts) { drawRemoteTimers = pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg); } timers.Clear(); - cSortedTimers SortedTimers; + LOCK_TIMERS_READ; + cSortedTimers SortedTimers(Timers); //if remotetimers plugin is available, take timers also from him if (drawRemoteTimers) { cTimer* remoteTimer = NULL; @@ -705,7 +706,7 @@ void cNopacityDisplayMenu::Flush(void) { if (MenuCategory() == mcMain) { if (config.GetValue("showDiscUsage")) DrawDisk(); - bool timersChanged = Timers.Modified(lastTimersState); + bool timersChanged = true; int numConflicts = 0; if (config.GetValue("checkTimerConflict")) numConflicts = CheckTimerConflict(timersChanged); diff --git a/imagecache.c b/imagecache.c index 29690c3..e7db262 100644 --- a/imagecache.c +++ b/imagecache.c @@ -43,7 +43,8 @@ void cImageCache::CreateCache(void) { //Channel Logos if (config.GetValue("numLogosInitial") > 0) { int channelsCached = 0; - for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { + LOCK_CHANNELS_READ; + for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) { if (channelsCached >= config.GetValue("numLogosInitial")) break; if (!channel->GroupSep()) { diff --git a/menudetailview.c b/menudetailview.c index e2a323a..d59b186 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -66,7 +66,8 @@ void cNopacityDetailView::InitiateViewType(void) { dateTime = cString::sprintf("%s %s - %s (%d %s)", *ev->GetDateString(), *ev->GetTimeString(), *ev->GetEndTimeString(), ev->Duration()/60, tr("min")); } view->SetDateTime(*dateTime); - view->SetChannel(Channels.GetByChannelID(ev->ChannelID(), true)); + LOCK_CHANNELS_READ; + view->SetChannel(Channels->GetByChannelID(ev->ChannelID(), true)); view->SetEventID(ev->EventID()); break; } case dvRecording: { @@ -89,7 +90,8 @@ void cNopacityDetailView::InitiateViewType(void) { view->SetTitle(info->Title()); view->SetSubTitle(info->ShortText()); view->SetInfoText(info->Description()); - view->SetChannel(Channels.GetByChannelID(info->ChannelID(), true)); + LOCK_CHANNELS_READ; + view->SetChannel(Channels->GetByChannelID(info->ChannelID(), true)); } else { view->SetTitle(rec->Name()); } @@ -176,7 +178,8 @@ std::string cNopacityDetailView::LoadReruns(void) { continue; i++; sstrReruns << *DayDateTime(r->event->StartTime()); - cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true); + LOCK_CHANNELS_READ; + const cChannel *channel = Channels->GetByChannelID(r->event->ChannelID(), true, true); if (channel) { sstrReruns << ", " << trVDR("Channel") << " " << channel->Number() << ":"; sstrReruns << " " << channel->ShortName(true); @@ -262,7 +265,8 @@ std::string cNopacityDetailView::LoadRecordingInformation(void) { std::stringstream sstrInfo; - cChannel *channel = Channels.GetByChannelID(Info->ChannelID()); + LOCK_CHANNELS_READ; + const cChannel *channel = Channels->GetByChannelID(Info->ChannelID()); if (channel) sstrInfo << trVDR("Channel") << ": " << channel->Number() << " - " << channel->Name() << std::endl; if (nRecSize < 0) { @@ -832,10 +832,8 @@ void cNopacityChannelMenuItem::DrawBackground(void) { } void cNopacityChannelMenuItem::readCurrentEPG(void) { - cSchedulesLock schedulesLock; - const cSchedules *schedules = cSchedules::Schedules(schedulesLock); - const cSchedule *Schedule = NULL; - Schedule = schedules->GetSchedule(Channel); + LOCK_SCHEDULES_READ; + const cSchedule *Schedule = Schedules->GetSchedule(Channel); if (!Schedule) { strEpgInfo = tr("No EPG Information found"); strTimeInfo = ""; @@ -853,10 +851,8 @@ void cNopacityChannelMenuItem::readCurrentEPG(void) { std::string cNopacityChannelMenuItem::readEPG(void) { std::stringstream sstrText; - cSchedulesLock schedulesLock; - const cSchedules *schedules = cSchedules::Schedules(schedulesLock); - const cSchedule *Schedule = NULL; - Schedule = schedules->GetSchedule(Channel); + LOCK_SCHEDULES_READ; + const cSchedule *Schedule = Schedules->GetSchedule(Channel); if (!Schedule) { sstrText << tr("No EPG Information found"); } else { |