summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/thread/qmutex.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 403468a..19e2457 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -437,15 +437,12 @@ void QMutex::lockInternal()
do {
if (spinCount++ > maximumSpinCount) {
- // puts("spinning useless, sleeping");
- bool isLocked = d->contenders.testAndSetAcquire(0, 1);
- if (!isLocked) {
-
- // didn't get the lock, wait for it
- isLocked = d->wait();
- Q_ASSERT_X(isLocked, "QMutex::lock",
- "Internal error, infinite wait has timed out.");
- }
+ // didn't get the lock, wait for it
+ bool isLocked = d->wait();
+ Q_ASSERT_X(isLocked, "QMutex::lock",
+ "Internal error, infinite wait has timed out.");
+ Q_UNUSED(isLocked);
+
// decrease the lastSpinCount since we didn't actually get the lock by spinning
spinCount = -d->lastSpinCount / SpinCountPenalizationDivisor;
break;