Mutexes(3)
π NAME π
Mutexes β okay so this is the Mutexes(3) page from the Library Functions Manual, bestie π. It's your group chat for mutex support: every class, function, and variable is right here, and I'm not dropping a single one.
π Classes π
struct std::adopt_lock_tβ assume the calling thread has already obtained mutex ownership and manage it. That's the whole assignment, slay.struct std::defer_lock_tβ do not acquire ownership of the mutex. Literally just don't, periodt.class std::lock_errorβ thrown to indicate errors with lock operations. It's giving "something went wrong with locking" energy.class std::lock_guard< _Mutex >β the scoped lock idiom, iconic behavior.class std::mutexβmutex. That's the description, no extra lore, and honestly same.struct std::once_flagβonce_flag. Again, the page keeps it short and iconic.class std::recursive_mutexβrecursive_mutex.class std::recursive_timed_mutexβrecursive_timed_mutex.class std::timed_mutexβtimed_mutex.struct std::try_to_lock_tβ try to acquire ownership of the mutex without blocking. No blocking, no waiting, just vibes.class std::unique_lock< _Mutex >βunique_lock.
β¨ Functions β¨
Heads up: a bunch of these only get a signature on this page, so I'm not inventing extra lore β I'm just handing you the exact function, bestie.
unique_lock< mutex > & std::__get_once_functor_lock ()β listed as-is; no extra description in the original.void std::__once_proxy ()β listed as-is; no extra description in the original.template<typename _Callable , typename... _Args> void std::call_once (once_flag &__once, _Callable __f, _Args &&...__args)β thecall_oncefunction signature, exactly.template<typename _L1 , typename _L2 , typename... _L3> void std::lock (_L1 &, _L2 &, _L3 &...)β thelockfunction signature, exactly.template<typename _Mutex > void std::swap (unique_lock< _Mutex > &__x, unique_lock< _Mutex > &&__y)β one of theswapoverloads, exactly.template<typename _Mutex > void std::swap (unique_lock< _Mutex > &&__x, unique_lock< _Mutex > &__y)β anotherswapoverload, exactly.template<typename _Mutex > void std::swap (unique_lock< _Mutex > &__x, unique_lock< _Mutex > &__y)β the thirdswapoverload, exactly.template<typename _Lock1 , typename _Lock2 , typename... _Lock3> int std::try_lock (_Lock1 &__l1, _Lock2 &__l2, _Lock3 &...__l3)β thetry_lockfunction signature, exactly.
π¦ Variables π¦
function< void()> std::__once_functorβ variable, exactly as named.const adopt_lock_t std::adopt_lockβ theadopt_lockvariable, exactly.const defer_lock_t std::defer_lockβ thedefer_lockvariable, exactly.const try_to_lock_t std::try_to_lockβ thetry_to_lockvariable, exactly.
πΈ Detailed Description πΈ
Classes for mutex support.
That's the whole detailed description, and it ate β short, sweet, and not a crumb missing π .
π₯ Function Documentation π₯
π« std::call_once π«
template<typename _Callable , typename... _Args> void std::call_once (once_flag & __once, _Callable __f, _Args &&... __args) [inline]
call_once
Definition at line 741 of file mutex.
References std::once_flag::_M_once, std::bind(), std::unique_lock< _Mutex >::lock(), and std::unique_lock< _Mutex >::unlock().
π std::lock π
template<typename _L1 , typename _L2 , typename... _L3> void std::lock (_L1 &, _L2 &, _L3 & ...) [inline]
lock
π§ std::try_lock π§
template<typename _Lock1 , typename _Lock2 , typename... _Lock3> int std::try_lock (_Lock1 & __l1, _Lock2 & __l2, _Lock3 &... __l3) [inline]
Generic try_lock.
Parameters:
__l1β Meets Mutex requirements (try_lock()may throw).__l2β Meets Mutex requirements (try_lock()may throw).__l3β Meets Mutex requirements (try_lock()may throw).
Returns: Returns -1 if all try_lock() calls return true. Otherwise returns a 0-based index corresponding to the argument that returned false.
Postcondition: Either all arguments are locked, or none will be.
Sequentially calls try_lock() on each argument.
Definition at line 686 of file mutex.
References std::try_lock().
Referenced by std::try_lock().
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
β¨ Source/version:libstdc++; date:21 Apr 2009. ThisMutexes(3)page is officially signed off β bye bestie, mwah π π
π¦ where this page comes from
- nixpkgs unstable: std-man-pages 4.4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms