summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-12-13 13:50:07 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-12-13 14:44:17 (GMT)
commitf0a892a46fdc438277c8b401c267db4bd92aec1b (patch)
treedbafc4610c9f787eb5895e0ab67cd79557eef1c5 /src/corelib
parentb8f639f27a05043f9f9ac371352508d6527f0123 (diff)
downloadQt-f0a892a46fdc438277c8b401c267db4bd92aec1b.zip
Qt-f0a892a46fdc438277c8b401c267db4bd92aec1b.tar.gz
Qt-f0a892a46fdc438277c8b401c267db4bd92aec1b.tar.bz2
Fix ABA problem with: the serial must be updated on all accesses
The nextFreeTimerId's serial counter was only being updated on timer ID releasing. It needs to be updated on allocation too. Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index 1c1c6e3..5619921 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -151,7 +151,7 @@ int QAbstractEventDispatcherPrivate::allocateTimerId()
}
}
- newTimerId = b[at];
+ newTimerId = prepareNewValueWithSerialNumber(timerId, b[at]);
} while (!nextFreeTimerId.testAndSetRelaxed(timerId, newTimerId));
return timerId;