add some threadsafety

Origin commit data
------------------
Branch: ni/coolstream
Commit: 53b767f2d4
Author: TangoCash <eric@loxat.de>
Date: 2018-09-20 (Thu, 20 Sep 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
TangoCash
2018-09-20 14:18:07 +02:00
committed by vanhofen
parent a7294bee63
commit 09b4b0e0bd

View File

@@ -808,6 +808,15 @@ void CBouquetManager::clearAll(bool user)
if (!user)
Bouquets = tmplist;
remainChannels = NULL;
if(thrLogo != 0)
{
pthread_cancel(thrLogo);
pthread_join(thrLogo, NULL);
thrLogo = 0;
}
pthread_mutex_lock (&mutex);
LogoList.clear();
pthread_mutex_unlock (&mutex);
}
void CBouquetManager::deletePosition(t_satellite_position satellitePosition)
@@ -1042,7 +1051,9 @@ void CBouquetManager::loadWebchannels(int mode)
if (!alogo.empty())
{
channel->setAlternateLogo(alogo);
pthread_mutex_lock (&mutex);
LogoList.push_back(channel);
pthread_mutex_unlock (&mutex);
}
channel->flags = CZapitChannel::UPDATED;
if (gbouquet)
@@ -1135,6 +1146,7 @@ void CBouquetManager::loadLogos()
void* CBouquetManager::LogoThread(void* _logolist)
{
set_threadname(__func__);
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
pthread_mutex_lock (&mutex);
ZapitChannelList *LogoList = (ZapitChannelList *)_logolist;
for (ZapitChannelList::iterator it = LogoList->begin(); it != LogoList->end(); ++it)