.TH "std::unique_lock< _Mutex >" 3cxx "Thu Feb 16 2023" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::unique_lock< _Mutex > \- A movable scoped lock type\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Types" .in +1c .ti -1c .RI "typedef _Mutex \fBmutex_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBunique_lock\fP (const \fBunique_lock\fP &)=delete" .br .ti -1c .RI "\fBunique_lock\fP (mutex_type &__m)" .br .ti -1c .RI "\fBunique_lock\fP (mutex_type &__m, \fBadopt_lock_t\fP) noexcept" .br .ti -1c .RI "template \fBunique_lock\fP (mutex_type &__m, const \fBchrono::duration\fP< _Rep, _Period > &__rtime)" .br .ti -1c .RI "template \fBunique_lock\fP (mutex_type &__m, const \fBchrono::time_point\fP< _Clock, _Duration > &__atime)" .br .ti -1c .RI "\fBunique_lock\fP (mutex_type &__m, \fBdefer_lock_t\fP) noexcept" .br .ti -1c .RI "\fBunique_lock\fP (mutex_type &__m, \fBtry_to_lock_t\fP)" .br .ti -1c .RI "\fBunique_lock\fP (\fBunique_lock\fP &&__u) noexcept" .br .ti -1c .RI "void \fBlock\fP ()" .br .ti -1c .RI "mutex_type * \fBmutex\fP () const noexcept" .br .ti -1c .RI "\fBoperator bool\fP () const noexcept" .br .ti -1c .RI "\fBunique_lock\fP & \fBoperator=\fP (const \fBunique_lock\fP &)=delete" .br .ti -1c .RI "\fBunique_lock\fP & \fBoperator=\fP (\fBunique_lock\fP &&__u) noexcept" .br .ti -1c .RI "bool \fBowns_lock\fP () const noexcept" .br .ti -1c .RI "mutex_type * \fBrelease\fP () noexcept" .br .ti -1c .RI "void \fBswap\fP (\fBunique_lock\fP &__u) noexcept" .br .ti -1c .RI "bool \fBtry_lock\fP ()" .br .ti -1c .RI "template bool \fBtry_lock_for\fP (const \fBchrono::duration\fP< _Rep, _Period > &__rtime)" .br .ti -1c .RI "template bool \fBtry_lock_until\fP (const \fBchrono::time_point\fP< _Clock, _Duration > &__atime)" .br .ti -1c .RI "void \fBunlock\fP ()" .br .in -1c .SS "Related Functions" (Note that these are not member functions\&.) .in +1c .ti -1c .RI "template void \fBswap\fP (\fBunique_lock\fP< _Mutex > &__x, \fBunique_lock\fP< _Mutex > &__y) noexcept" .br .RI "Swap overload for unique_lock objects\&. " .in -1c .SH "Detailed Description" .PP .SS "template .br class std::unique_lock< _Mutex >"A movable scoped lock type\&. A unique_lock controls mutex ownership within a scope\&. Ownership of the mutex can be delayed until after construction and can be transferred to another unique_lock by move construction or move assignment\&. If a mutex lock is owned when the destructor runs ownership will be released\&. .PP Definition at line \fB57\fP of file \fBunique_lock\&.h\fP\&. .SH "Member Typedef Documentation" .PP .SS "template typedef _Mutex \fBstd::unique_lock\fP< _Mutex >::mutex_type" .PP Definition at line \fB60\fP of file \fBunique_lock\&.h\fP\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::unique_lock\fP< _Mutex >::unique_lock ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB62\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBstd::unique_lock\fP< _Mutex >::unique_lock (mutex_type & __m)\fC [inline]\fP, \fC [explicit]\fP" .PP Definition at line \fB66\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBstd::unique_lock\fP< _Mutex >::unique_lock (mutex_type & __m, \fBdefer_lock_t\fP)\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB73\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBstd::unique_lock\fP< _Mutex >::unique_lock (mutex_type & __m, \fBtry_to_lock_t\fP)\fC [inline]\fP" .PP Definition at line \fB77\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBstd::unique_lock\fP< _Mutex >::unique_lock (mutex_type & __m, \fBadopt_lock_t\fP)\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB81\fP of file \fBunique_lock\&.h\fP\&. .SS "template template \fBstd::unique_lock\fP< _Mutex >::unique_lock (mutex_type & __m, const \fBchrono::time_point\fP< _Clock, _Duration > & __atime)\fC [inline]\fP" .PP Definition at line \fB88\fP of file \fBunique_lock\&.h\fP\&. .SS "template template \fBstd::unique_lock\fP< _Mutex >::unique_lock (mutex_type & __m, const \fBchrono::duration\fP< _Rep, _Period > & __rtime)\fC [inline]\fP" .PP Definition at line \fB95\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBstd::unique_lock\fP< _Mutex >::~\fBunique_lock\fP ()\fC [inline]\fP" .PP Definition at line \fB101\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBstd::unique_lock\fP< _Mutex >::unique_lock (\fBunique_lock\fP< _Mutex > && __u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB110\fP of file \fBunique_lock\&.h\fP\&. .SH "Member Function Documentation" .PP .SS "template void \fBstd::unique_lock\fP< _Mutex >::lock ()\fC [inline]\fP" .PP Definition at line \fB131\fP of file \fBunique_lock\&.h\fP\&. .SS "template mutex_type * \fBstd::unique_lock\fP< _Mutex >::mutex () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB224\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBstd::unique_lock\fP< _Mutex >::operator bool () const\fC [inline]\fP, \fC [explicit]\fP, \fC [noexcept]\fP" .PP Definition at line \fB220\fP of file \fBunique_lock\&.h\fP\&. .SS "template \fBunique_lock\fP & \fBstd::unique_lock\fP< _Mutex >::operator= (\fBunique_lock\fP< _Mutex > && __u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB117\fP of file \fBunique_lock\&.h\fP\&. .SS "template bool \fBstd::unique_lock\fP< _Mutex >::owns_lock () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB217\fP of file \fBunique_lock\&.h\fP\&. .SS "template mutex_type * \fBstd::unique_lock\fP< _Mutex >::release ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB208\fP of file \fBunique_lock\&.h\fP\&. .SS "template void \fBstd::unique_lock\fP< _Mutex >::swap (\fBunique_lock\fP< _Mutex > & __u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Definition at line \fB201\fP of file \fBunique_lock\&.h\fP\&. .SS "template bool \fBstd::unique_lock\fP< _Mutex >::try_lock ()\fC [inline]\fP" .PP Definition at line \fB145\fP of file \fBunique_lock\&.h\fP\&. .SS "template template bool \fBstd::unique_lock\fP< _Mutex >::try_lock_for (const \fBchrono::duration\fP< _Rep, _Period > & __rtime)\fC [inline]\fP" .PP Definition at line \fB175\fP of file \fBunique_lock\&.h\fP\&. .SS "template template bool \fBstd::unique_lock\fP< _Mutex >::try_lock_until (const \fBchrono::time_point\fP< _Clock, _Duration > & __atime)\fC [inline]\fP" .PP Definition at line \fB160\fP of file \fBunique_lock\&.h\fP\&. .SS "template void \fBstd::unique_lock\fP< _Mutex >::unlock ()\fC [inline]\fP" .PP Definition at line \fB189\fP of file \fBunique_lock\&.h\fP\&. .SH "Friends And Related Function Documentation" .PP .SS "template void swap (\fBunique_lock\fP< _Mutex > & __x, \fBunique_lock\fP< _Mutex > & __y)\fC [related]\fP" .PP Swap overload for unique_lock objects\&. .PP Definition at line \fB236\fP of file \fBunique_lock\&.h\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.