std::shared...shared_lock(3)

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

πŸ¦‹ std::shared_lock::~shared_lock πŸ¦‹

okay so this is the std::shared...shared_lock(3) page from the C++ Standard Libary manual, and we are literally here for the destructor of std::shared_lock. bestie, it’s giving cleanup era, and no cap it’s important. πŸ’…


🌸 NAME 🌸

std::shared_lock::~shared_lock β€” yep, the whole name is std::shared_lock::~shared_lock. iconic, honestly. πŸŽ€

✨ Synopsis ✨

The signature is right here, and it’s marked since C++14:

~shared_lock();  (since C++14)

What it does: it destroys the lock. that’s the whole mood. πŸ’…

Here’s the careful part, because details are main character energy: if *this has an associated mutex β€” meaning mutex() returns a non-null pointer β€” and it has acquired ownership of that mutex β€” meaning owns() returns true β€” then the mutex is unlocked by calling unlock_shared(). πŸ”₯

bestie, the unlock happens when those conditions line up, fr fr. 🫢

cute little sign-off: this page came from http://cppreference.com, dated 2024.06.10, and it’s the std::shared...shared_lock(3) page. slay, bye πŸ’–βœ¨

πŸ“¦ where this page comes from