From 65e9dc4be556fc58abdc48bc77983a92465d1b79 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 10 Nov 2015 18:39:59 -0800 Subject: [PATCH] Fixup return types --- libraries/shared/src/shared/ReadWriteLockable.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/shared/src/shared/ReadWriteLockable.h b/libraries/shared/src/shared/ReadWriteLockable.h index 9279628e10..07b46bb92a 100644 --- a/libraries/shared/src/shared/ReadWriteLockable.h +++ b/libraries/shared/src/shared/ReadWriteLockable.h @@ -21,7 +21,7 @@ class ReadWriteLockable { public: // Write locks template - bool withWriteLock(F&& f) const; + void withWriteLock(F&& f) const; template bool withWriteLock(F&& f, bool require) const; @@ -34,7 +34,7 @@ public: // Read locks template - bool withReadLock(F&& f) const; + void withReadLock(F&& f) const; template bool withReadLock(F&& f, bool require) const; @@ -51,16 +51,16 @@ private: // ReadWriteLockable template -inline bool ReadWriteLockable::withWriteLock(F&& f) const { +inline void ReadWriteLockable::withWriteLock(F&& f) const { QWriteLocker locker(&_lock); f(); - return true; } template inline bool ReadWriteLockable::withWriteLock(F&& f, bool require) const { if (require) { - return withWriteLock(std::forward(f)); + withWriteLock(std::forward(f)); + return true; } else { return withTryReadLock(std::forward(f)); } @@ -87,16 +87,16 @@ inline bool ReadWriteLockable::withTryWriteLock(F&& f, int timeout) const { } template -inline bool ReadWriteLockable::withReadLock(F&& f) const { +inline void ReadWriteLockable::withReadLock(F&& f) const { QReadLocker locker(&_lock); f(); - return true; } template inline bool ReadWriteLockable::withReadLock(F&& f, bool require) const { if (require) { - return withReadLock(std::forward(f)); + withReadLock(std::forward(f)); + return true; } else { return withTryReadLock(std::forward(f)); }