Skip to content

Commit

Permalink
Merge pull request #4097 from uklotzde/qtmutex
Browse files Browse the repository at this point in the history
Add [[nodiscard]] to lockMutex()
  • Loading branch information
Be-ing authored Jul 10, 2021
2 parents 7cad4cc + f9d596b commit c7d5334
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/qtmutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
#define QT_MUTEX_LOCKER QT_MUTEX_LOCKER_TYPE(QMutex)
#define QT_RECURSIVE_MUTEX_LOCKER QT_MUTEX_LOCKER_TYPE(QT_RECURSIVE_MUTEX)

inline QT_MUTEX_LOCKER lockMutex(QMutex* pMutex) {
[[nodiscard]] inline QT_MUTEX_LOCKER lockMutex(QMutex* pMutex) {
return QT_MUTEX_LOCKER(pMutex);
}

#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
inline QT_RECURSIVE_MUTEX_LOCKER lockMutex(QRecursiveMutex* pMutex) {
[[nodiscard]] inline QT_RECURSIVE_MUTEX_LOCKER lockMutex(QRecursiveMutex* pMutex) {
return QT_RECURSIVE_MUTEX_LOCKER(pMutex);
}
#endif

0 comments on commit c7d5334

Please sign in to comment.