std::scoped...scoped_lock(3)

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

πŸ’– NAME πŸ’–

Okay bestie, this is std::scoped...scoped_lock(3) from the C++ Standard Libary manual β€” yes, that's the manual name as written β€” and it's all about the destructor:

  • std::scoped_lock::~scoped_lock β€” literally std::scoped_lock::~scoped_lock again, that's the name, no cap πŸ’…

✨ Synopsis ✨

Here's the signature, short and iconic:

~scoped_lock();  (since C++17)

So what does this destructor do? It releases the ownership of the owned mutexes. ✨

Effectively, it calls unlock() on every mutex from the pack of mutexes passed to the scoped_lock's constructor. That's the whole vibe. πŸ’–


Source/version: http://cppreference.com, dated 2024.06.10. Bye bestie, go live your scoped-lock truth πŸ«Άβœ¨πŸ’…

πŸ“¦ where this page comes from