std::recurs...tex::unlock(3)
πΈ NAME πΈ
okay so bestie, this is the std::recursive_mutex::unlock page from the C++ Standard Libary manual. It's the unlock member function for std::recursive_mutex, and she's literally here to handle your ownership level π
.
β¨ Synopsis β¨
void unlock(); (since C++11)
so what does she do? She unlocks the mutex if its level of ownership is 1 β meaning there was exactly one more call to lock() than there were calls to unlock() made by this thread. Otherwise, she reduces the level of ownership by 1 β¨.
π¨ The mutex must be locked by the current thread of execution, otherwise the behavior is undefined. no cap, that part is serious π
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 vibe π₯
π Parameters π
(none) β she takes nothing, not even a little snack π.
π«Ά Return value π«Ά
(none) β returns nothing, she's too iconic for that.
π Exceptions π
Throws nothing. literally nothing. zero. π³οΈ
π Notes π
unlock() is usually not called directly: std::unique_lock and std::lock_guard are used to manage exclusive locking. so like, let the guard girlies handle it π
.
π¦ Example π¦
This section is incomplete Reason: no example
π 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β the C side of the story, linked from here.
Category: * Todo no example
mwah π source: http://cppreference.com Β· version/date: 2024.06.10 Β· footer page name: std::recurs...tex::unlock(3). bye bestie, go unlock 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