std::shared_mutex::unlock(3)

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

πŸ’– 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