mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
add some threadsafety
Origin commit data
------------------
Commit: 53b767f2d4
Author: TangoCash <eric@loxat.de>
Date: 2018-09-20 (Thu, 20 Sep 2018)
This commit is contained in:
@@ -808,6 +808,15 @@ void CBouquetManager::clearAll(bool user)
|
|||||||
if (!user)
|
if (!user)
|
||||||
Bouquets = tmplist;
|
Bouquets = tmplist;
|
||||||
remainChannels = NULL;
|
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)
|
void CBouquetManager::deletePosition(t_satellite_position satellitePosition)
|
||||||
@@ -1042,7 +1051,9 @@ void CBouquetManager::loadWebchannels(int mode)
|
|||||||
if (!alogo.empty())
|
if (!alogo.empty())
|
||||||
{
|
{
|
||||||
channel->setAlternateLogo(alogo);
|
channel->setAlternateLogo(alogo);
|
||||||
|
pthread_mutex_lock (&mutex);
|
||||||
LogoList.push_back(channel);
|
LogoList.push_back(channel);
|
||||||
|
pthread_mutex_unlock (&mutex);
|
||||||
}
|
}
|
||||||
channel->flags = CZapitChannel::UPDATED;
|
channel->flags = CZapitChannel::UPDATED;
|
||||||
if (gbouquet)
|
if (gbouquet)
|
||||||
@@ -1135,6 +1146,7 @@ void CBouquetManager::loadLogos()
|
|||||||
void* CBouquetManager::LogoThread(void* _logolist)
|
void* CBouquetManager::LogoThread(void* _logolist)
|
||||||
{
|
{
|
||||||
set_threadname(__func__);
|
set_threadname(__func__);
|
||||||
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
||||||
pthread_mutex_lock (&mutex);
|
pthread_mutex_lock (&mutex);
|
||||||
ZapitChannelList *LogoList = (ZapitChannelList *)_logolist;
|
ZapitChannelList *LogoList = (ZapitChannelList *)_logolist;
|
||||||
for (ZapitChannelList::iterator it = LogoList->begin(); it != LogoList->end(); ++it)
|
for (ZapitChannelList::iterator it = LogoList->begin(); it != LogoList->end(); ++it)
|
||||||
|
Reference in New Issue
Block a user