diff options
Diffstat (limited to 'src/corelib/thread/qreadwritelock_p.h')
-rw-r--r-- | src/corelib/thread/qreadwritelock_p.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/thread/qreadwritelock_p.h b/src/corelib/thread/qreadwritelock_p.h index d1f887eb45..68fa642a73 100644 --- a/src/corelib/thread/qreadwritelock_p.h +++ b/src/corelib/thread/qreadwritelock_p.h @@ -45,9 +45,10 @@ public: explicit QReadWriteLockPrivate(bool isRecursive = false) : recursive(isRecursive) {} - QtPrivate::mutex mutex; - QtPrivate::condition_variable writerCond; - QtPrivate::condition_variable readerCond; + alignas(QtPrivate::IdealMutexAlignment) std::condition_variable writerCond; + std::condition_variable readerCond; + + alignas(QtPrivate::IdealMutexAlignment) std::mutex mutex; int readerCount = 0; int writerCount = 0; int waitingReaders = 0; @@ -55,8 +56,8 @@ public: const bool recursive; //Called with the mutex locked - bool lockForWrite(std::unique_lock<QtPrivate::mutex> &lock, QDeadlineTimer timeout); - bool lockForRead(std::unique_lock<QtPrivate::mutex> &lock, QDeadlineTimer timeout); + bool lockForWrite(std::unique_lock<std::mutex> &lock, QDeadlineTimer timeout); + bool lockForRead(std::unique_lock<std::mutex> &lock, QDeadlineTimer timeout); void unlock(); //memory management |