std::timed_mutex(3cxx)

πŸ’– std::timed_mutex πŸ’–

okay so bestie, welcome to the 3cxx manual page from libstdc++ β€” yes, the icon itself is std::timed_mutex, and we're getting into it. ✨


πŸ’– NAME πŸ’–

std::timed_mutex β€” that's the name, bestie. πŸ’…

✨ SYNOPSIS ✨

The include is literally:

#include <mutex>

and this one inherits __mutex_base, and __timed_mutex_impl< timed_mutex >. πŸ¦‹

πŸŽ€ Public Types πŸŽ€

  • native_handle_type β€” exact typedef tea: typedef __native_type * native_handle_type.

πŸ¦‹ Public Member Functions πŸ¦‹

Full signature stack, verbatim because we do not mess with code:

timed_mutex (const timed_mutex &)=delete
void lock ()
native_handle_type native_handle () noexcept
timed_mutex & operator= (const timed_mutex &)=delete
bool try_lock () noexcept
template<class _Rep , class _Period > bool try_lock_for (const
    chrono::duration< _Rep, _Period > &__rtime)
template<class _Clock , class _Duration > bool try_lock_until (const
    chrono::time_point< _Clock, _Duration > &__atime)
void unlock ()

Quick vibe check: the copy constructor timed_mutex (const timed_mutex &)=delete is deleted, and the assignment operator timed_mutex & operator= (const timed_mutex &)=delete is also deleted πŸ’€. native_handle () and try_lock () are both noexcept. lock () and unlock () return void. The two template ones are try_lock_for with chrono::duration< _Rep, _Period > &__rtime and try_lock_until with chrono::time_point< _Clock, _Duration > &__atime. That's the whole roster. 🫢

🌸 Friends 🌸

  • class __timed_mutex_impl< timed_mutex > β€” yup, that's the friend. iykyk. πŸ’œ

πŸ’… Detailed Description πŸ’…

The standard timed mutex type. It's giving main character energy in <mutex> land. ✨

A non-recursive mutex that supports a timeout when trying to acquire the lock. So yes, it's a mutex with a little patience timer built in for the trying-to-lock moment β€” no cap. πŸ•°οΈ

⭐ Since ⭐

C++11 β€” iconic since day one, bestie. πŸŽ€


πŸ‘‘ Author πŸ‘‘

Not a mysterious human author, lol: Generated automatically by Doxygen for libstdc++ from the source code. πŸ€–πŸ’–


okay bye bestie, cute sign-off time: this page is from libstdc++, manual page std::timed_mutex(3cxx), and the original footer does not print a date β€” so source/version: libstdc++; date: not listed. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from