std::shared_timed_mutex(3cxx)
π std::shared_timed_mutex π
okay bestie, welcome to the 3cxx manual page for std::shared_timed_mutex β yes that's the libstdc++ section, we're in the C++ girlie corner of the manual now, stay with me π«Ά
β¨ NAME β¨
std::shared_timed_mutex β literally the standard shared timed mutex type. that's it, that's the whole vibe. no cap. π
πΈ SYNOPSIS πΈ
#include <shared_mutex>
and plot twist, it inherits __shared_timed_mutex_base. family tree matters, iykyk π§
π Public Member Functions π
shared_timed_mutex (const shared_timed_mutex &)=deleteβ nope, not copyable, the copy constructor is deleted, she does not do duplicates πvoid lock ()β grabs the lock, iconic blocking behaviour β¨void lock_shared ()β grabs it in shared mode, so multiple besties can hold it at once πΈshared_timed_mutex & operator= (const shared_timed_mutex &)=deleteβ assignment is also deleted, no hand-me-downs, periodt πbool try_lock ()β tries to lock, returns aboolinstead of just waiting forever, main character energy πtemplate<typename _Rep , typename _Period > bool try_lock_for (const chrono::duration< _Rep, _Period > &__rtime)β try to lock but only for achrono::durationyou name as__rtime, returnsboolβ³bool try_lock_shared ()β same try energy but in shared mode, returnsboolπ₯template<typename _Rep , typename _Period > bool try_lock_shared_for (const chrono::duration< _Rep, _Period > &__rtime)β shared + timed attempt with thatchrono::duration< _Rep, _Period > &__rtime, returnsboolπ¦template<typename _Clock , typename _Duration > bool try_lock_shared_until (const chrono::time_point< _Clock, _Duration > &__abs_time)β shared attempt that runs until an absolutechrono::time_point< _Clock, _Duration > &__abs_time, returnsboolβtemplate<typename _Clock , typename _Duration > bool try_lock_until (const chrono::time_point< _Clock, _Duration > &__abs_time)β the exclusive version of the until-attempt, takesconst chrono::time_point< _Clock, _Duration > &__abs_time, returnsboolπvoid unlock ()β releases the lock, go off πvoid unlock_shared ()β releases the shared lock, ty bestie π«Ά
π Detailed Description π
The standard shared timed mutex type. that's the summary, she said what she said β¨
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. so like, the docs are literally auto-generated, not me writing them by hand, ngl π€
lowkey a reminder: everything up there is copied verbatim from the original page β the=deletes stay deleted, the templates stay templated, and none of theboolreturn values got dropped π
okay and finally, the cute little sign-off: this whole page is brought to you by libstdc++ in section 3cxx of the manual, exactly where the footer put it. slay, go write some thread-safe code, 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