diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-01-08 15:03:39 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-01-09 12:05:11 +0100 |
commit | 3fc9f97d61f5cf6a5d4941ddb4b6cd94136dc646 (patch) | |
tree | 2a36c0d97d4861293a2600dad344c1a37a6cb589 /src/corelib/thread | |
parent | 7bd3d4591a126cd99f797f1a9f83c966547e29e1 (diff) | |
download | qtbase-3fc9f97d61f5cf6a5d4941ddb4b6cd94136dc646.tar.gz |
QMutex/QReadWriteLock: mark bootstrap implementations nothrow
This is primarily to get a cleaner build of src/tools
under -Wnoexcept.
Change-Id: I0dea21e70aad56b25675fc59fac0327b55ee83e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qmutex.h | 20 | ||||
-rw-r--r-- | src/corelib/thread/qreadwritelock.h | 36 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 626ba0b1bb..acbd9f32d1 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -176,12 +176,12 @@ class Q_CORE_EXPORT QMutex public: enum RecursionMode { NonRecursive, Recursive }; - inline explicit QMutex(RecursionMode mode = NonRecursive) { Q_UNUSED(mode); } + inline explicit QMutex(RecursionMode mode = NonRecursive) Q_DECL_NOTHROW { Q_UNUSED(mode); } - inline void lock() {} - inline bool tryLock(int timeout = 0) { Q_UNUSED(timeout); return true; } - inline void unlock() {} - inline bool isRecursive() { return true; } + inline void lock() Q_DECL_NOTHROW {} + inline bool tryLock(int timeout = 0) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; } + inline void unlock() Q_DECL_NOTHROW {} + inline bool isRecursive() Q_DECL_NOTHROW { return true; } private: Q_DISABLE_COPY(QMutex) @@ -190,12 +190,12 @@ private: class Q_CORE_EXPORT QMutexLocker { public: - inline explicit QMutexLocker(QMutex *) {} - inline ~QMutexLocker() {} + inline explicit QMutexLocker(QMutex *) Q_DECL_NOTHROW {} + inline ~QMutexLocker() Q_DECL_NOTHROW {} - inline void unlock() {} - void relock() {} - inline QMutex *mutex() const { return 0; } + inline void unlock() Q_DECL_NOTHROW {} + void relock() Q_DECL_NOTHROW {} + inline QMutex *mutex() const Q_DECL_NOTHROW { return Q_NULLPTR; } private: Q_DISABLE_COPY(QMutexLocker) diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h index 4260d090b6..01adaa927a 100644 --- a/src/corelib/thread/qreadwritelock.h +++ b/src/corelib/thread/qreadwritelock.h @@ -172,18 +172,18 @@ class Q_CORE_EXPORT QReadWriteLock { public: enum RecursionMode { NonRecursive, Recursive }; - inline explicit QReadWriteLock(RecursionMode = NonRecursive) { } + inline explicit QReadWriteLock(RecursionMode = NonRecursive) Q_DECL_NOTHROW { } inline ~QReadWriteLock() { } - static inline void lockForRead() { } - static inline bool tryLockForRead() { return true; } - static inline bool tryLockForRead(int timeout) { Q_UNUSED(timeout); return true; } + static inline void lockForRead() Q_DECL_NOTHROW { } + static inline bool tryLockForRead() Q_DECL_NOTHROW { return true; } + static inline bool tryLockForRead(int timeout) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; } - static inline void lockForWrite() { } - static inline bool tryLockForWrite() { return true; } - static inline bool tryLockForWrite(int timeout) { Q_UNUSED(timeout); return true; } + static inline void lockForWrite() Q_DECL_NOTHROW { } + static inline bool tryLockForWrite() Q_DECL_NOTHROW { return true; } + static inline bool tryLockForWrite(int timeout) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; } - static inline void unlock() { } + static inline void unlock() Q_DECL_NOTHROW { } private: Q_DISABLE_COPY(QReadWriteLock) @@ -192,12 +192,12 @@ private: class Q_CORE_EXPORT QReadLocker { public: - inline QReadLocker(QReadWriteLock *) { } - inline ~QReadLocker() { } + inline QReadLocker(QReadWriteLock *) Q_DECL_NOTHROW { } + inline ~QReadLocker() Q_DECL_NOTHROW { } - static inline void unlock() { } - static inline void relock() { } - static inline QReadWriteLock *readWriteLock() { return 0; } + static inline void unlock() Q_DECL_NOTHROW { } + static inline void relock() Q_DECL_NOTHROW { } + static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return Q_NULLPTR; } private: Q_DISABLE_COPY(QReadLocker) @@ -206,12 +206,12 @@ private: class Q_CORE_EXPORT QWriteLocker { public: - inline explicit QWriteLocker(QReadWriteLock *) { } - inline ~QWriteLocker() { } + inline explicit QWriteLocker(QReadWriteLock *) Q_DECL_NOTHROW { } + inline ~QWriteLocker() Q_DECL_NOTHROW { } - static inline void unlock() { } - static inline void relock() { } - static inline QReadWriteLock *readWriteLock() { return 0; } + static inline void unlock() Q_DECL_NOTHROW { } + static inline void relock() Q_DECL_NOTHROW { } + static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return Q_NULLPTR; } private: Q_DISABLE_COPY(QWriteLocker) |