refs #522, mutex for mutable members (thread safe)

* copy/assignment/lock for mutable members
* also removed redundant in status message (slack discussion MS/KB)
This commit is contained in:
Klaus Basan
2015-11-26 02:31:13 +01:00
parent a4ba45ce75
commit d6733d49bb
13 changed files with 115 additions and 73 deletions

View File

@@ -19,6 +19,24 @@ namespace BlackMisc
{
CUrlList::CUrlList() { }
CUrlList::CUrlList(const CUrlList &other) : CSequence<CUrl>(other)
{
*this = other;
}
CUrlList &CUrlList::operator =(const CUrlList &other)
{
if (this == &other) { return *this; }
QReadLocker readLock(&other.m_lock);
int index = other.m_currentIndexDistributedLoad;
readLock.unlock(); // avoid deadlock
QWriteLocker writeLock(&this->m_lock);
this->m_currentIndexDistributedLoad = index;
return *this;
}
CUrlList::CUrlList(const QStringList &listOfUrls, bool removeDuplicates)
{
QStringList urlList(listOfUrls);