From 6476ac738ca029af95932f53b53f0705808eb80e Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 29 Sep 2011 11:50:08 +0200 Subject: Replace implicit QAtomic* casts with explicit load()/store() Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira --- src/corelib/concurrent/qtconcurrentiteratekernel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/concurrent/qtconcurrentiteratekernel.h') diff --git a/src/corelib/concurrent/qtconcurrentiteratekernel.h b/src/corelib/concurrent/qtconcurrentiteratekernel.h index c6fcb973ab5..49c053caf7b 100644 --- a/src/corelib/concurrent/qtconcurrentiteratekernel.h +++ b/src/corelib/concurrent/qtconcurrentiteratekernel.h @@ -214,9 +214,9 @@ public: bool shouldStartThread() { if (forIteration) - return (currentIndex < iterationCount) && !this->shouldThrottleThread(); + return (currentIndex.load() < iterationCount) && !this->shouldThrottleThread(); else // whileIteration - return (iteratorThreads == 0); + return (iteratorThreads.load() == 0); } ThreadFunctionResult threadFunction() @@ -238,7 +238,7 @@ public: const int currentBlockSize = blockSizeManager.blockSize(); - if (currentIndex >= iterationCount) + if (currentIndex.load() >= iterationCount) break; // Atomically reserve a block of iterationCount for this thread. @@ -269,7 +269,7 @@ public: // Report progress if progress reporting enabled. if (progressReportingEnabled) { completed.fetchAndAddAcquire(finalBlockSize); - this->setProgressValue(this->completed); + this->setProgressValue(this->completed.load()); } if (this->shouldThrottleThread()) -- cgit v1.2.3