Mutexes(3)

πŸ“¦ version 4.4.0, in nixpkgs unstable

πŸŽ€ 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) β€” the call_once function signature, exactly.
  • template<typename _L1 , typename _L2 , typename... _L3> void std::lock (_L1 &, _L2 &, _L3 &...) β€” the lock function signature, exactly.
  • template<typename _Mutex > void std::swap (unique_lock< _Mutex > &__x, unique_lock< _Mutex > &&__y) β€” one of the swap overloads, exactly.
  • template<typename _Mutex > void std::swap (unique_lock< _Mutex > &&__x, unique_lock< _Mutex > &__y) β€” another swap overload, exactly.
  • template<typename _Mutex > void std::swap (unique_lock< _Mutex > &__x, unique_lock< _Mutex > &__y) β€” the third swap overload, exactly.
  • template<typename _Lock1 , typename _Lock2 , typename... _Lock3> int std::try_lock (_Lock1 &__l1, _Lock2 &__l2, _Lock3 &...__l3) β€” the try_lock function signature, exactly.

πŸ¦‹ Variables πŸ¦‹

  • function< void()> std::__once_functor β€” variable, exactly as named.
  • const adopt_lock_t std::adopt_lock β€” the adopt_lock variable, exactly.
  • const defer_lock_t std::defer_lock β€” the defer_lock variable, exactly.
  • const try_to_lock_t std::try_to_lock β€” the try_to_lock variable, 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. This Mutexes(3) page is officially signed off β€” bye bestie, mwah πŸ’…πŸ’–
πŸ“¦ where this page comes from