logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

std::unique_lock< _Mutex > - A movable scoped lock type.

Author

       Generated automatically by Doxygen for libstdc++ from the source code.

                                                    libstdc++                   std::unique_lock<_Mutex>(3cxx)

Detailed Description

template<typename_Mutex>
       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.

       Since
           C++11

Name

       std::unique_lock< _Mutex > - A movable scoped lock type.

Synopsis

       #include <mutex>

   PublicTypestypedef_Mutexmutex_typePublicMemberFunctionsunique_lock (const unique_lock &)=deleteunique_lock (mutex_type &__m)
       unique_lock (mutex_type &__m, adopt_lock_t) noexcept
       template<typename _Rep , typename_Period > unique_lock (mutex_type &__m, const chrono::duration< _Rep,
           _Period > &__rtime)
       template<typename_Clock , typename_Duration > unique_lock (mutex_type &__m, const chrono::time_point<
           _Clock, _Duration > &__atime)
       unique_lock (mutex_type &__m, defer_lock_t) noexcept
       unique_lock (mutex_type &__m, try_to_lock_t)
       unique_lock (unique_lock &&__u) noexcept
       voidlock ()
       mutex_type * mutex () const noexcept
       operatorbool () const noexcept
       unique_lock & operator= (const unique_lock &)=deleteunique_lock & operator= (unique_lock &&__u) noexcept
       bool owns_lock () const noexcept
       mutex_type * release () noexcept
       voidswap (unique_lock &__u) noexcept
       bool try_lock ()
       template<typename _Rep , typename_Period > bool try_lock_for (const chrono::duration< _Rep, _Period >
           &__rtime)
       template<typename_Clock , typename_Duration > bool try_lock_until (const chrono::time_point< _Clock,
           _Duration > &__atime)
       voidunlock ()

   RelatedSymbols
       (Note that these are not member symbols.)
       template<typename_Mutex > voidswap (unique_lock< _Mutex > &__x, unique_lock< _Mutex > &__y) noexcept
           Swap overload for unique_lock objects.

See Also