std::recursive_timed_mutex(3cxx)
πΈ NAME πΈ
okay so std::recursive_timed_mutex is the main character of this page, and the manual name is 3cxx β we're in the C++ docs, bestie, and it's giving library royalty πβ¨
β¨ SYNOPSIS β¨
you get it with:
#include <mutex>
and the inheritance situation is literally:
- inherits
__recursive_mutex_base - inherits
__timed_mutex_impl< recursive_timed_mutex >
both of those, exactly as written. no cap π«Ά
π Public Types π
typedef __native_type * native_handle_typeβ the one public type, and it is the native handle type. that's the whole vibe check π
π Public Member Functions π
okay bestie, here's the full roster β no skipping, because every signature matters:
recursive_timed_mutex (const recursive_timed_mutex &)=deleteβ copying it? absolutely deleted, not today πvoid lock ()β locks the mutex. remember the recursive rules from the detailed description: the same thread can lock more than once, and other threads wait until the unlocks match the locks.native_handle_type native_handle () noexceptβ hands you thenative_handle_type, and it's markednoexcept. slay.recursive_timed_mutex & operator= (const recursive_timed_mutex &)=deleteβ assignment? deleted too, bestie πbool try_lock () noexceptβ tries to lock, and it'snoexcept. that's it, that's the function.template<class _Rep , class _Period > bool try_lock_for (const chrono::duration< _Rep, _Period > &__rtime)β timeout try-lock, takingconst chrono::duration< _Rep, _Period > &__rtime. it's giving "wait a little" energy β³template<class _Clock , class _Duration > bool try_lock_until (const chrono::time_point< _Clock, _Duration > &__atime)β timeout try-lock until a point in time, takingconst chrono::time_point< _Clock, _Duration > &__atime. clock-based and iconic π°οΈvoid unlock ()β unlocks. recursive mutex says unlock it as many times as it was locked, periodt π
π«Ά Friends π«Ά
class __timed_mutex_impl< recursive_timed_mutex >β this one is a friend. yes, the whole friend list is just this, and we respect it π«‘
π¦ Detailed Description π¦
okay so the tea is:
this is the standard recursive timed mutex type. it's a recursive mutex that supports a timeout when trying to acquire the lock. a recursive mutex can be locked more than once by the same thread. other threads cannot lock the mutex until the owning thread unlocks it as many times as it was locked. literally the whole personality, no cap π
β Since β
C++11, bestie. it's been serving since C++11 β¨
π Author π
not a human author moment: Generated automatically by Doxygen for libstdc++ from the source code. thank you Doxygen and libstdc++ for the lore π
okay that's the page! source/version: libstdc++; page: std::recursive_timed_mutex(3cxx); date: the footer didn't bring one, so I'm not inventing one, bestie β no cap. bye and slay π«Άπ
π¦ 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