std::shared_mutex::unlock(3)
π std::shared_mutex::unlock(3) π
std::shared_mutex::unlock β okay so this is the unlock member function of std::shared_mutex, straight out of the C++ Standard Libary manual (section 3), and it's literally the "let go of the mutex" girlie. π
π¦ SYNOPSIS π¦
void unlock(); (since C++17)
Unlocks the mutex. That's the whole vibe. π
bestie, listen: the mutex must be locked by the current thread of execution, otherwise the behavior is undefined. not "maybe fine", not "we'll see" β undefined. π
This operation synchronizes-with (as defined in std::memory_order) any subsequent lock operation that obtains ownership of the same mutex. no cap, that's the memory-ordering tea. β¨
π PARAMETERS π
(none) β zero, nada, nothing, babe. π
β¨ RETURN VALUE β¨
(none) β it returns nothing and honestly? iconic. it doesn't need to give anything back. π
π EXCEPTIONS π
Throws nothing. not one exception. slay. π
π§ NOTES π§
unlock() is usually not called directly: std::unique_lock and std::lock_guard are used to manage exclusive locking. so like, you can call it directly, but the cool kids let the RAII girlies handle it. π§
π EXAMPLE π
This section is incomplete. Reason: no example
literally no example yet π the docs said "This section is incomplete" and the reason is "no example". we're waiting, bestie. π
π SEE ALSO π
lockβ locks the mutex, blocks if the mutex is not available (public member function)try_lockβ tries to lock the mutex, returns if the mutex is not available (public member function)- C documentation for
mtx_unlock
π CATEGORY π
- Todo no example
mwah π this page is from http://cppreference.com, dated 2024.06.10, and it's the std::shared_mutex::unlock(3) page β catch you in the group chat! π«Ά
π¦ 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