std::shared_lock::release(3)

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

πŸ’… std::shared_lock::release(3) πŸ’…

okay so this is from the C++ Standard Libary (yes, β€œLibary” is spelled like that up top, and we are respectfully keeping the typo πŸ’€), and it’s all about std::shared_lock::release. It’s giving β€œbreak the association, not the lock” energy. πŸ¦‹


🌸 NAME 🌸

std::shared_lock::release β€” literally std::shared_lock::release, bestie. That’s the name. No cap. ✨

✨ Synopsis ✨

mutex_type* release() noexcept;  (since C++14)

Breaks the association of the associated mutex, if any, and *this.

No locks are unlocked. 🚨 If *this held ownership of the associated mutex prior to the call, the caller is now responsible to unlock the mutex.

⚠️ read that again, bestie: this does not unlock anything. If you had ownership before, you own the unlocking job now. Periodt. πŸ’…

🫢 Parameters 🫢

(none) β€” no parameters, zero, zilch, not a single argument. Slay. πŸ’–

πŸŽ€ Return value πŸŽ€

Pointer to the associated mutex or a null pointer if there was no associated mutex. That’s the whole return-value tea. ⭐

😭 Example 😭

This section is incomplete Reason: no example

yeah bestie, there is literally no example here. πŸ“­ not me hoping for a little demo… πŸ™ˆ

πŸ‘€ See also πŸ‘€

  • unlock β€” unlocks the associated mutex (public member function).
  • disassociates the associated mutex without unlocking (i.e., releasing release ownership of) it (public member function of std::unique_lock<Mutex>).

πŸ—‚οΈ Category πŸ—‚οΈ

  • Todo no example

πŸ’– source: http://cppreference.com Β· date: 2024.06.10 Β· page: std::shared_lock::release(3) πŸ’–

πŸ“¦ where this page comes from