STD::SCOPED_LOCK(3cxx)
π std::scoped_lock< _MutexTypes > β a scoped lock type for multiple lockable objects
okay bestie so you found your way into section 3cxx of the manual, which is where the C++ library stuff lives π and this one?? this one is a banger. it's the lock that holds several things at once and then politely lets go when it goes out of scope. main character energy fr fr.
β¨ NAME β¨
std::scoped_lock< _MutexTypes > β A scoped lock type for multiple lockable objects.
like. its whole job. its whole personality. locking multiple lockables. π«Ά
πΈ SYNOPSIS πΈ
#include <mutex>
π Public Member Functions
scoped_lock (_MutexTypes &... __m)β the constructor, takes all your mutexes by reference πscoped_lock (adopt_lock_t, _MutexTypes &... __m) noexceptβ the "no bestie I already locked them, just adopt them" constructor, and it'snoexceptso it will NOT be dramatic about itscoped_lock (const scoped_lock &)=deleteβ copy constructor? deleted. not a thing. not allowed. absolutely not. πscoped_lock & operator= (const scoped_lock &)=deleteβ copy assignment? also deleted. we do not duplicate locks in this house π«
π¦ Detailed Description π¦
template<typename... _MutexTypes>
class std::scoped_lock< _MutexTypes >
"A scoped lock type for multiple lockable objects.
A scoped_lock controls mutex ownership within a scope, releasing ownership in the destructor.
π Since
C++17 β¨ (yes, she's been iconic since 2017, we been knew)
π§ Author π§
Generated automatically by Doxygen for libstdc++ from the source code.
(not a human, just a little robot doing its best π«Άβ¨)
π see you later bestie π
that's the whole page! and just so you know, this lil' beauty ships with libstdc++, and you'll find it filed under std::scoped_lock< _MutexTypes >(3cxx). go lock something safely, periodt π
π
π¦ where this page comes from
- ubuntu resolute: libstdc++-12-doc 12.5.0-9ubuntu1
- ubuntu resolute: libstdc++-13-doc 13.4.0-10ubuntu1
- ubuntu stonking: libstdc++-12-doc 12.5.0-9ubuntu1
- ubuntu stonking: libstdc++-13-doc 13.5.0-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms