Kleo::UniqueLock
#include <uniquelock.h>
Public Member Functions | |
UniqueLock (const UniqueLock &)=delete | |
UniqueLock (QMutex &mutex) | |
UniqueLock (QMutex &mutex, AdoptLockType) noexcept | |
template<typename Rep , typename Period > | |
UniqueLock (QMutex &mutex, const std::chrono::duration< Rep, Period > &duration) | |
template<typename Clock , typename Duration > | |
UniqueLock (QMutex &mutex, const std::chrono::time_point< Clock, Duration > &timePoint) | |
UniqueLock (QMutex &mutex, DeferLockType) noexcept | |
UniqueLock (QMutex &mutex, TryToLockType) | |
UniqueLock (UniqueLock &&u) noexcept | |
void | lock () |
QMutex * | mutex () const noexcept |
operator bool () const noexcept | |
UniqueLock & | operator= (const UniqueLock &)=delete |
UniqueLock & | operator= (UniqueLock &&u) noexcept |
bool | owns_lock () const noexcept |
QMutex * | release () noexcept |
void | swap (UniqueLock &u) noexcept |
bool | try_lock () |
template<typename Rep , typename Period > | |
bool | try_lock_for (const std::chrono::duration< Rep, Period > &duration) |
template<typename Clock , typename Duration > | |
bool | try_lock_until (const std::chrono::time_point< Clock, Duration > &timePoint) |
void | unlock () |
Detailed Description
A movable scoped lock type for QMutex.
A UniqueLock controls mutex ownership within a scope. Ownership of the mutex can be delayed until after construction and can be transferred to another UniqueLock by move construction or move assignment. If a mutex lock is owned when the destructor runs ownership will be released.
Definition at line 57 of file uniquelock.h.
Constructor & Destructor Documentation
◆ UniqueLock() [1/8]
|
noexcept |
Definition at line 22 of file uniquelock.cpp.
◆ UniqueLock() [2/8]
|
explicit |
Definition at line 28 of file uniquelock.cpp.
◆ UniqueLock() [3/8]
|
noexcept |
Definition at line 36 of file uniquelock.cpp.
◆ UniqueLock() [4/8]
Kleo::UniqueLock::UniqueLock | ( | QMutex & | mutex, |
TryToLockType | ) |
Definition at line 42 of file uniquelock.cpp.
◆ UniqueLock() [5/8]
|
noexcept |
Definition at line 48 of file uniquelock.cpp.
◆ UniqueLock() [6/8]
|
inline |
Definition at line 68 of file uniquelock.h.
◆ UniqueLock() [7/8]
|
inline |
Definition at line 75 of file uniquelock.h.
◆ ~UniqueLock()
Kleo::UniqueLock::~UniqueLock | ( | ) |
Definition at line 55 of file uniquelock.cpp.
◆ UniqueLock() [8/8]
|
noexcept |
Definition at line 62 of file uniquelock.cpp.
Member Function Documentation
◆ lock()
void Kleo::UniqueLock::lock | ( | ) |
Definition at line 84 of file uniquelock.cpp.
◆ mutex()
|
noexcept |
Definition at line 148 of file uniquelock.cpp.
◆ operator bool()
|
explicitnoexcept |
Definition at line 143 of file uniquelock.cpp.
◆ operator=()
|
noexcept |
Definition at line 70 of file uniquelock.cpp.
◆ owns_lock()
|
noexcept |
Definition at line 138 of file uniquelock.cpp.
◆ release()
|
noexcept |
Definition at line 130 of file uniquelock.cpp.
◆ swap()
|
noexcept |
Definition at line 124 of file uniquelock.cpp.
◆ try_lock()
bool Kleo::UniqueLock::try_lock | ( | ) |
Definition at line 98 of file uniquelock.cpp.
◆ try_lock_for()
|
inline |
Definition at line 105 of file uniquelock.h.
◆ try_lock_until()
|
inline |
Definition at line 94 of file uniquelock.h.
◆ unlock()
void Kleo::UniqueLock::unlock | ( | ) |
Definition at line 114 of file uniquelock.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.