diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2017-11-13 12:49:02 +0100 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2018-01-24 09:20:27 +0000 |
commit | 7911a4f0480e3e5371515f211601b69606e32d50 (patch) | |
tree | 3eae910ecfa86da83ef4a28cd1f6a3a0253f7032 | |
parent | 3387809ba9e159f5179e3df5b9408bc34966cd4a (diff) |
Fix thread synchronization issue in tst_qwebengineprofile
Change-Id: I7b7c4a6501387b1d657e55f222908365990b8fef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp index 6961f3b6d..c443ee114 100644 --- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -200,9 +200,13 @@ public: } bool isSequential() const override { return true; } qint64 bytesAvailable() const override - { return m_bytesAvailable; } + { + QMutexLocker lock(&m_mutex); + return m_bytesAvailable; + } bool atEnd() const override { + QMutexLocker lock(&m_mutex); return (m_data.size() >= 1000 && m_bytesRead >= 1000); } protected: @@ -237,7 +241,7 @@ protected: } private: - QMutex m_mutex; + mutable QMutex m_mutex{QMutex::Recursive}; QByteArray m_data; QBasicTimer m_timer; int m_bytesRead; |