std::mutex(3cxx)
π NAME π
std::mutex β the standard mutex type, bestie, and this page is from the 3cxx manual. She's simple, non-recursive, and non-timed, and she's about to get the full group-chat rundown π
β¨ SYNOPSIS β¨
#include <mutex>
Inherits __mutex_base.
π Public Types π
typedef __native_type * native_handle_typeβ the native handle type, slay.
πΈ Public Member Functions πΈ
mutex (const mutex &)=deleteβ copying? not happening, it's deleted.void lock ()β the lock one (but bestie, read the warning below first π).native_handle_type native_handle () noexceptβ grab the native handle,noexceptand all.mutex & operator= (const mutex &)=deleteβ assignment? also deleted, periodt.bool try_lock () noexceptβ tries the lock and returnsbool,noexcept.void unlock ()β the unlock one (again: warning below, okay? π«Ά).
π¦ Detailed Description π¦
The standard mutex type.
A simple, non-recursive, non-timed mutex.
Do not call lock() and unlock() directly β seriously, bestie, use a scoped lock type such as std::unique_lock, std::lock_guard, or (since C++17) std::scoped_lock.
This is the part where you let the scoped lock do the main character work. Callinglock()andunlock()by hand is not the vibe π
β Since β
C++11 β that's when this icon entered the chat π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. No human author to thank here, just Doxygen doing its thing π
mwah π β source/version libstdc++, page std::mutex(3cxx); the footer had no date line, so I'm not inventing one, bestie π«Ά
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms