std::recurs...ursive_mutex(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

okay so welcome to the std::recurs...ursive_mutex(3) page from the C++ Standard Libary β€” yes, that’s the manual name, folded in right here at the top like a little name tag 🫢. The star of the show is std::recursive_mutex::recursive_mutex, and we’re about to get into its constructor business. No cap.


✨ NAME ✨

std::recursive_mutex::recursive_mutex β€” std::recursive_mutex::recursive_mutex. That’s the whole name, bestie, and it’s giving β€œwe are here for the constructor” πŸ’….

πŸ¦‹ Synopsis πŸ¦‹

          recursive_mutex();                                  (1) (since C++11)
          recursive_mutex( const recursive_mutex& ) = delete; (2) (since C++11)

okay so there are two constructor-ish lines, both since C++11:

  1. recursive_mutex(); β€” this one constructs the mutex. After the call, the mutex is in unlocked state. Slay.
  2. recursive_mutex( const recursive_mutex& ) = delete; β€” the copy constructor is deleted. Not me trying to copy a recursive_mutex; it’s literally deleted, fr fr.

πŸŽ€ Parameters πŸŽ€

(none) β€” bestie, there are no parameters here. Zero. None. The parameter list is on a little vacation πŸ“.

πŸ’€ Exceptions πŸ’€

If the construction is unsuccessful, you get std::system_error. That’s the exception tea β˜• β€” keep it in mind.

πŸ”₯ See also πŸ”₯

If you want the C-side lore, check the C documentation for mtx_init. iykyk 🌈.


source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::recurs...ursive_mutex(3) β€” mwah, bestie, go build something iconic πŸ’–βœ¨

πŸ“¦ where this page comes from