diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 17:46:16 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 17:46:34 +0200 |
commit | 440286655e0ca271506cf7cc02ad0dbf4baef9ca (patch) | |
tree | 896fa81adb8b14a69355a3a6cf64d06ec8173c9a /src/corelib/thread/qfutureinterface.h | |
parent | 1e27ad1697187549151657ba187928e439300db7 (diff) | |
parent | e164d61ca8263fc4b46fdd916e1ea77c7dd2b735 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
Diffstat (limited to 'src/corelib/thread/qfutureinterface.h')
-rw-r--r-- | src/corelib/thread/qfutureinterface.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h index bcdae24833..43dfd6bac4 100644 --- a/src/corelib/thread/qfutureinterface.h +++ b/src/corelib/thread/qfutureinterface.h @@ -119,8 +119,7 @@ public: void waitForResult(int resultIndex); void waitForResume(); - QMutex *mutex() const; - QMutex &mutex(int) const; + QMutex &mutex() const; QtPrivate::ExceptionStore &exceptionStore(); QtPrivate::ResultStoreBase &resultStoreBase(); const QtPrivate::ResultStoreBase &resultStoreBase() const; @@ -191,7 +190,7 @@ public: template <typename T> inline void QFutureInterface<T>::reportResult(const T *result, int index) { - std::lock_guard<QMutex> locker(mutex(0)); + std::lock_guard<QMutex> locker{mutex()}; if (this->queryState(Canceled) || this->queryState(Finished)) { return; } @@ -217,7 +216,7 @@ inline void QFutureInterface<T>::reportResult(const T &result, int index) template <typename T> inline void QFutureInterface<T>::reportResults(const QVector<T> &_results, int beginIndex, int count) { - std::lock_guard<QMutex> locker(mutex(0)); + std::lock_guard<QMutex> locker{mutex()}; if (this->queryState(Canceled) || this->queryState(Finished)) { return; } @@ -245,14 +244,14 @@ inline void QFutureInterface<T>::reportFinished(const T *result) template <typename T> inline const T &QFutureInterface<T>::resultReference(int index) const { - std::lock_guard<QMutex> locker(mutex(0)); + std::lock_guard<QMutex> locker{mutex()}; return resultStoreBase().resultAt(index).template value<T>(); } template <typename T> inline const T *QFutureInterface<T>::resultPointer(int index) const { - std::lock_guard<QMutex> locker(mutex(0)); + std::lock_guard<QMutex> locker{mutex()}; return resultStoreBase().resultAt(index).template pointer<T>(); } @@ -266,7 +265,7 @@ inline QList<T> QFutureInterface<T>::results() QFutureInterfaceBase::waitForResult(-1); QList<T> res; - std::lock_guard<QMutex> locker(mutex(0)); + std::lock_guard<QMutex> locker{mutex()}; QtPrivate::ResultIteratorBase it = resultStoreBase().begin(); while (it != resultStoreBase().end()) { |