std::recursive_mutex(3cxx)

NAME

std::recursive_mutex β€” the standard recursive mutex type, and yes this is the 3cxx manual page, bestie. πŸ’…

SYNOPSIS

#include <mutex>

Inherits __recursive_mutex_base. (so it's got that base class energy, periodt)

Public Types

  • typedef __native_type * native_handle_type β€” the native handle type, lowkey your backstage pass to the underlying handle, iykyk. 🎟️

Public Member Functions

  • recursive_mutex (const recursive_mutex &)=delete β€” copy constructor? deleted. not today, satan. πŸ™ˆ
  • void lock () β€” locks the mutex. and if you're the same thread, you can do it again, no cap. πŸ”’
  • native_handle_type native_handle () noexcept β€” returns the native handle. it's noexcept, so it's giving reliable. ✨
  • recursive_mutex & operator= (const recursive_mutex &)=delete β€” copy assignment? also deleted. we don't do that here. πŸ’€
  • bool try_lock () noexcept β€” tries to lock it, returns a bool. noexcept, so no drama. πŸŽ€
  • void unlock () β€” unlocks. you gotta do it as many times as you locked it, fr fr. πŸ”“

Detailed Description

Okay so a recursive mutex is literally the standard recursive mutex type. 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. That's the whole vibe. πŸŒ€

warning: the copy constructor and copy assignment are =delete, so no copying. it's giving exclusive. 🚫

Since

C++11. so it's been iconic since 2011, we love a legacy queen. πŸ‘‘

Author

Generated automatically by Doxygen for libstdc++ from the source code. no cap, the robots did this one. πŸ€–


this page is brought to you by libstdc++ and the manual page std::recursive_mutex(3cxx). it's giving documentation realness. πŸ’–βœ¨

πŸ“¦ where this page comes from