std::shared_lock::unlock(3)

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

πŸ’– NAME πŸ’– β€” std::shared_lock::unlock(3) from the C++ Standard Libary manual

okay so bestie, welcome to the page for std::shared_lock::unlock β€” yes, the shared-lock unlock function, and it is literally the β€œlet go of the shared lock” moment. Main character energy for your mutex, honestly. πŸ’…

🌸 Synopsis 🌸

void unlock();  (since C++14)

Unlocks the associated mutex from shared mode. Effectively calls mutex()->unlock_shared().

std::system_error is thrown if there is no associated mutex or if the mutex is not locked.

πŸŽ€ Parameters πŸŽ€

(none) β€” not a single parameter, bestie. Lowkey zero. None. 🫢

✨ Return value ✨

(none) β€” it returns nothing, it just does the unlock thing. Periodt.

πŸ’₯ Exceptions πŸ’₯

  • Any exceptions thrown by mutex()->unlock_shared().
  • If there is no associated mutex, std::system_error with an error code of std::errc::operation_not_permitted.
bestie please note: no associated mutex or a mutex that isn’t locked means std::system_error, okay? No cap, that’s the exception vibe. 😭

🧚 Example 🧚

This section is incomplete.

Reason: no example.

Not me wanting an example too, but that’s what the page says. πŸ™ˆ

πŸ”₯ See also πŸ”₯

  • lock β€” locks the associated mutex (public member function)
  • release β€” disassociates the mutex without unlocking (public member function)

πŸ¦‹ Category πŸ¦‹

  • Todo no example

xoxo, your Unix bestie πŸ’œ β€” source: http://cppreference.com, version/date: 2024.06.10, page: std::shared_lock::unlock(3)

πŸ“¦ where this page comes from