std::shared...lock_shared(3)
okay so bestie, welcome to the C++ Standard Libary manual corner β¨ (yes, βLibaryβ is literally how the header spells it, weβre keeping the lore π). todayβs main character is std::shared_timed_mutex::unlock_shared, and sheβs here to release a shared lock. letβs get into it. π«Ά
π NAME π
std::shared_timed_mutex::unlock_shared β std::shared_timed_mutex::unlock_shared
like yes, the manpage lists it twice, and honestly? duplicate queen behavior. π
β¨ Synopsis β¨
void unlock_shared(); (since C++14)
Releases the mutex from shared ownership by the calling thread. π¦
The mutex must be locked by the current thread of execution in shared mode, otherwise, the behavior is undefined. π no cap, undefined behavior is the scary one β do not play with that.
This operation synchronizes-with (as defined in std::memory_order) any subsequent lock() operation that obtains ownership of the same mutex. π₯
πΈ Parameters πΈ
(none) β literally no parameters, she takes nothing, we love a low-maintenance icon. π
π Return value π
(none) β returns nothing, and thatβs iconic. periodt.
π Exceptions π
Throws nothing. not a single exception, sheβs chill like that. π
π¦ Notes π¦
unlock_shared() is usually not called directly: std::shared_lock is used to manage shared locking. so like, let the std::shared_lock bestie handle it, iykyk. π
π Example π
This section is incomplete Reason: no example
π itβs giving unfinished homework, but thatβs exactly what the manpage says, so weβre not gonna invent one.
π§ 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
from http://cppreference.com, dated 2024.06.10, page std::shared...lock_shared(3) β mwah πβ¨
π¦ 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