diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-26 11:32:55 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-26 11:33:19 +0200 |
commit | 7810209ba32fcebfa90b081670595daaa5333a78 (patch) | |
tree | 98410d5cc7d9d762bbde0cb4eae8041aa6e2e542 /src/concurrent/qtconcurrentiteratekernel.h | |
parent | 6f2eabb54e3f827ebd2b90f68144b86342933869 (diff) | |
parent | 88625709058b386ee74cca536c6c5556159c99fa (diff) |
Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I4ea2b77cc201daed94fbe321f146dfd20365a534
Diffstat (limited to 'src/concurrent/qtconcurrentiteratekernel.h')
-rw-r--r-- | src/concurrent/qtconcurrentiteratekernel.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h index 89fd3d2592..3095c9ff52 100644 --- a/src/concurrent/qtconcurrentiteratekernel.h +++ b/src/concurrent/qtconcurrentiteratekernel.h @@ -206,9 +206,9 @@ public: bool shouldStartThread() override { if (forIteration) - return (currentIndex.load() < iterationCount) && !this->shouldThrottleThread(); + return (currentIndex.loadRelaxed() < iterationCount) && !this->shouldThrottleThread(); else // whileIteration - return (iteratorThreads.load() == 0); + return (iteratorThreads.loadRelaxed() == 0); } ThreadFunctionResult threadFunction() override @@ -230,7 +230,7 @@ public: const int currentBlockSize = blockSizeManager.blockSize(); - if (currentIndex.load() >= iterationCount) + if (currentIndex.loadRelaxed() >= iterationCount) break; // Atomically reserve a block of iterationCount for this thread. @@ -261,7 +261,7 @@ public: // Report progress if progress reporting enabled. if (progressReportingEnabled) { completed.fetchAndAddAcquire(finalBlockSize); - this->setProgressValue(this->completed.load()); + this->setProgressValue(this->completed.loadRelaxed()); } if (this->shouldThrottleThread()) |