mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user