diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2011-08-14 13:56:38 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2011-08-14 13:56:38 (GMT) |
commit | 9be758009e1a4c616377dc33ccf1e55dd8b04d9b (patch) | |
tree | 3138a0d18d53a00498b4cad59f934a4e64762cf8 /qtools/qmutex.cpp | |
parent | 64f0c97c3adaa28edf6f1da3264621a18c1d1adb (diff) | |
download | Doxygen-9be758009e1a4c616377dc33ccf1e55dd8b04d9b.zip Doxygen-9be758009e1a4c616377dc33ccf1e55dd8b04d9b.tar.gz Doxygen-9be758009e1a4c616377dc33ccf1e55dd8b04d9b.tar.bz2 |
Release-1.7.5
Diffstat (limited to 'qtools/qmutex.cpp')
-rw-r--r-- | qtools/qmutex.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/qtools/qmutex.cpp b/qtools/qmutex.cpp index fda5f07..08a13bc 100644 --- a/qtools/qmutex.cpp +++ b/qtools/qmutex.cpp @@ -59,7 +59,7 @@ void QMutex::lock() { //printf("%p: QMutex::lock(): enter\n",this); bool isLocked; - isLocked = d->contenders == 0 && d->contenders.testAndSet(0, 1); + isLocked = d->contenders.testAndSet(0, 1); if (!isLocked) { isLocked = d->contenders.fetchAndAdd(1)==0; @@ -78,8 +78,7 @@ void QMutex::lock() bool QMutex::tryLock() { - bool isLocked = d->contenders == 0 && - d->contenders.testAndSet(0, 1); + bool isLocked = d->contenders.testAndSet(0, 1); return isLocked; } |