summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutex_linux.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@kde.org>2011-10-28 11:51:06 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-31 12:14:04 +0100
commit72257f642944a347b806ac34934d0fb8bc472b1c (patch)
treecf7dcd30be1b442e8d8dcc1afc5a0befbfc0d09f /src/corelib/thread/qmutex_linux.cpp
parent3c0a26b79f4ab8a20ac385c1f885ee18156a6555 (diff)
Rename QBasicMutex::d to QBasicMutex::d_ptr
Because we use d as a local variable. We used this->d to refer it, but this can be confusing to have twice the same name Change-Id: I570aa5f444ada358eb456d6b3d9b8bfa60b10bbf Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/thread/qmutex_linux.cpp')
-rw-r--r--src/corelib/thread/qmutex_linux.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp
index a3ca150a31..3e5b5f2f0d 100644
--- a/src/corelib/thread/qmutex_linux.cpp
+++ b/src/corelib/thread/qmutex_linux.cpp
@@ -82,14 +82,14 @@ bool QBasicMutex::lockInternal(int timeout)
elapsedTimer.start();
while (!fastTryLock()) {
- QMutexPrivate *d = this->d.load();
+ QMutexPrivate *d = d_ptr.load();
if (!d) // if d is 0, the mutex is unlocked
continue;
if (quintptr(d) <= 0x3) { //d == dummyLocked() || d == dummyFutexValue()
if (timeout == 0)
return false;
- while (this->d.fetchAndStoreAcquire(dummyFutexValue()) != 0) {
+ while (d_ptr.fetchAndStoreAcquire(dummyFutexValue()) != 0) {
struct timespec ts, *pts = 0;
if (timeout >= 1) {
// recalculate the timeout
@@ -103,7 +103,7 @@ bool QBasicMutex::lockInternal(int timeout)
ts.tv_nsec = xtimeout % (Q_INT64_C(1000) * 1000 * 1000);
pts = &ts;
}
- int r = _q_futex(&this->d, FUTEX_WAIT, quintptr(dummyFutexValue()), pts);
+ int r = _q_futex(&d_ptr, FUTEX_WAIT, quintptr(dummyFutexValue()), pts);
if (r != 0 && errno == ETIMEDOUT)
return false;
}
@@ -112,19 +112,19 @@ bool QBasicMutex::lockInternal(int timeout)
Q_ASSERT(d->recursive);
return static_cast<QRecursiveMutexPrivate *>(d)->lock(timeout);
}
- Q_ASSERT(this->d.load());
+ Q_ASSERT(d_ptr.load());
return true;
}
void QBasicMutex::unlockInternal()
{
- QMutexPrivate *d = this->d.load();
+ QMutexPrivate *d = d_ptr.load();
Q_ASSERT(d); //we must be locked
Q_ASSERT(d != dummyLocked()); // testAndSetRelease(dummyLocked(), 0) failed
if (d == dummyFutexValue()) {
- this->d.fetchAndStoreRelease(0);
- _q_futex(&this->d, FUTEX_WAKE, 1, 0);
+ d_ptr.fetchAndStoreRelease(0);
+ _q_futex(&d_ptr, FUTEX_WAKE, 1, 0);
return;
}