std::shared...lock_shared(3)
okay so this is std::shared...lock_shared(3) from the C++ Standard Libary manual β yes, the manual name is folded in right here, and we're moving on π
β¨
π NAME π
std::shared_mutex::unlock_shared β std::shared_mutex::unlock_shared (same thing twice, that's literally what the page says π«Ά)
β¨ Synopsis β¨
void unlock_shared(); (since C++17)
Releases the mutex from shared ownership by the calling thread. So if you're holding it in shared mode, this hands it back.
The mutex must be locked by the current thread of execution in shared mode, otherwise, the behavior is undefined. And bestie, undefined behavior is not a vibe β it's actual UB π.
This operation synchronizes-with (as defined in std::memory_order) any subsequent lock() operation that obtains ownership of the same mutex. That's the whole synchronization receipt, no cap.
πΈ Parameters πΈ
(none)β no parameters, she takes nothing π
π Return value π
(none)β returns nothing, periodt
π¦ Exceptions π¦
Throws nothing. Zero throws, zero drama, pristine exception energy β¨
π Notes π
unlock_shared() is usually not called directly: std::shared_lock is used to manage shared locking. So yeah, most of the time your bestie std::shared_lock is doing the management and you're just vibing.
π Example π
This section is incomplete Reason: no example
(Yes, that's the example section. It's giving placeholder era π)
π See also π
lock_sharedβ locks the mutex for shared ownership, blocks if the mutex is not available (public member function)unlockβ unlocks the mutex (public member function)
π·οΈ Category π·οΈ
Todo no example
source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::shared...lock_shared(3) β bye bestie, go release that shared ownership responsibly π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms