std::recur...imed_mutex(3)

✨ NAME ✨

std::recursive_timed_mutex β€” bestie, it's the standard recursive timed mutex type, and she's serving lock energy πŸ’…


🌸 SYNOPSIS 🌸

#include <mutex>

πŸŽ€ Public Types

  • typedef __native_type * native_handle_type β€” the native handle type, raw and unfiltered, lowkey the passport to whatever the implementation is actually doing underneath 🫢

πŸ”₯ Public Member Functions

  • recursive_timed_mutex (const recursive_timed_mutex &)=delete β€” copy constructor? deleted. gone. not happening. she does NOT do copies, periodt πŸ’€
  • void lock () β€” locks the mutex. if it's already locked by this same thread, it just locks again like it's nothing ✨
  • native_handle_type native_handle () noexcept β€” hands you the native handle, and it's marked noexcept so it will not be throwing hands πŸ™ˆ
  • recursive_timed_mutex & operator= (const recursive_timed_mutex &)=delete β€” assignment operator? also deleted. no assigning, no copying, none of it πŸŽ€
  • bool try_lock () noexcept β€” tries to lock, returns whether it worked, and it's noexcept so no surprises πŸ¦‹
  • template<class _Rep, class _Period> bool try_lock_for (const chrono::duration< _Rep, _Period > &__rtime) β€” tries to lock, but with a timeout β€” you give it a duration and it waits at most that long, bestie ⏳
  • template<class _Clock, class _Duration> bool try_lock_until (const chrono::time_point< _Clock, _Duration > &__atime) β€” tries to lock until a specific point in time. clock in, clock out πŸ•°οΈ
  • void unlock () β€” unlocks one level of locking. remember you have to unlock it as many times as you locked it, no skipping πŸ’…

🌈 Friends

  • class __timed_mutex_impl< recursive_timed_mutex > β€” the friend of the family, the implementation buddy that's allowed in the group chat 🫢

πŸ’– Detailed Description πŸ’–

The standard recursive timed mutex type. Yes, the whole thing. Iconic behavior, no cap ✨

A recursive mutex that supports a timeout when trying to acquire the lock. So you get both the "lock it more than once" lifestyle AND the "wait, but only for so long" lifestyle. Main character combo fr fr πŸ‘‘

A recursive mutex can be locked more than once by the same thread. That's the whole point β€” same thread, multiple locks, zero drama 🧚

Other threads cannot lock the mutex until the owning thread unlocks it as many times as it was locked. So if you locked it three times, bestie, you're unlocking it three times. It's giving counting, and you better keep up πŸ’€

Lock it n times β†’ unlock it n times. That's the deal. Every other thread is just sitting there waiting on you, and honestly? Same.

⭐ Since

  • C++11 β€” she's been here since C++11, an elder icon, we stan 🌸

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. So technically nobody wrote this, it just appeared, fully formed, like a butterfly πŸ¦‹


okay that's the whole page, bestie β€” every flag, every signature, every template param, all of it, untouched and slaying πŸ’–

sending you off with the vibe check: this page came from the libstdc++ crew, filed under std::recur...imed_mutex(3), and that's a wrap, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms