QFutureInterface: add missing mutex lock to progress getters
These variables are accessed from both the executing thread as well as the thread waiting for results. Note for some variables which threads access them. Change-Id: I1c84ddff92585abb32341c42072106066e485f7e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
4d5803775a
commit
c20920fbe1
@ -193,16 +193,19 @@ void QFutureInterfaceBase::waitForResume()
|
||||
|
||||
int QFutureInterfaceBase::progressValue() const
|
||||
{
|
||||
const QMutexLocker lock(&d->m_mutex);
|
||||
return d->m_progressValue;
|
||||
}
|
||||
|
||||
int QFutureInterfaceBase::progressMinimum() const
|
||||
{
|
||||
const QMutexLocker lock(&d->m_mutex);
|
||||
return d->m_progressMinimum;
|
||||
}
|
||||
|
||||
int QFutureInterfaceBase::progressMaximum() const
|
||||
{
|
||||
const QMutexLocker lock(&d->m_mutex);
|
||||
return d->m_progressMaximum;
|
||||
}
|
||||
|
||||
|
@ -146,18 +146,20 @@ public:
|
||||
QAtomicInt m_refCountT;
|
||||
};
|
||||
|
||||
// T: accessed from executing thread
|
||||
// Q: accessed from the waiting/querying thread
|
||||
RefCount refCount;
|
||||
mutable QMutex m_mutex;
|
||||
QWaitCondition waitCondition;
|
||||
QList<QFutureCallOutInterface *> outputConnections;
|
||||
int m_progressValue;
|
||||
int m_progressMinimum;
|
||||
int m_progressMaximum;
|
||||
int m_progressValue; // TQ
|
||||
int m_progressMinimum; // TQ
|
||||
int m_progressMaximum; // TQ
|
||||
QFutureInterfaceBase::State state;
|
||||
QElapsedTimer progressTime;
|
||||
QWaitCondition pausedWaitCondition;
|
||||
QtPrivate::ResultStoreBase m_results;
|
||||
bool manualProgress;
|
||||
bool manualProgress; // only accessed from executing thread
|
||||
int m_expectedResultCount;
|
||||
QtPrivate::ExceptionStore m_exceptionStore;
|
||||
QString m_progressText;
|
||||
|
Loading…
x
Reference in New Issue
Block a user