std::timed_mutex(3)

πŸ’– NAME πŸ’–

std::timed_mutex β€” bestie, it's the standard timed mutex type πŸ•°οΈβœ¨

(also hi, this is a page from the Library Functions Manual, we're in libstdc++ land πŸ’…)


✨ SYNOPSIS ✨

#include <mutex>

πŸŽ€ Public Types πŸŽ€

  • typedef __native_type * native_handle_type β€” the native handle type, aka the lil pointer to the underlying native thingie 🫢

πŸ’… Public Member Functions πŸ’…

  • timed_mutex (const timed_mutex &)=delete β€” copy constructor? deleted, no copies allowed, she's one of a kind πŸ’€
  • void lock () β€” takes the lock. periodt πŸ”’
  • native_handle_type native_handle () noexcept β€” hands you back the native handle, noexcept so she won't throw at you πŸ™ˆ
  • timed_mutex & operator= (const timed_mutex &)=delete β€” assignment operator? also deleted, not me being assignable 😭
  • bool try_lock () noexcept β€” tries to take the lock, noexcept, tells you yes or no ⭐
  • template<class _Rep, class _Period> bool try_lock_for (const chrono::duration< _Rep, _Period > &__rtime) β€” tries for a duration of time, template-y and chrono-flavored ⏳
  • template<class _Clock, class _Duration> bool try_lock_until (const chrono::time_point< _Clock, _Duration > &__atime) β€” tries until a specific time point, with a clock and everything πŸ•
  • void unlock () β€” releases the lock, ty for your service 🫑

🫢 Friends 🫢

  • class __timed_mutex_impl< timed_mutex > β€” yes she has friends, this one is lowkey the implementation bestie 🀝

🌈 DETAILED DESCRIPTION 🌈

Okay so, the standard timed mutex type. That's her.

A non-recursive mutex that supports a timeout when trying to acquire the lock. So like β€” she's not the kind of girl who lets you lock her twice from the same thread (non-recursive, remember that bestie), but she is the kind who'll let you say "okay I'll wait but only for this long" πŸ’…

πŸ¦‹ And yes, the timeout thing is the whole vibe. No timeout, no timed_mutex. That's the point.

Since: C++11 β€” she's been iconic since C++11 πŸ‘‘


πŸŽ€ AUTHOR πŸŽ€

Generated automatically by Doxygen for libstdc++ from the source code. (not a human author, just a robot doing her lil thing πŸ€–βœ¨)


okay that's the whole page bestie, no cap, every flag and signature intact 🫢 this was std::timed_mutex(3) from libstdc++, the Library Functions Manual β€” go forth and lock responsibly, 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