std::timed_mutex::unlock(3)

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

πŸ’… std::timed_mutex::unlock πŸ’…

okay so this page is from the C++ Standard Libary manual, section 3, and it's literally the std::timed_mutex::unlock page β€” bestie, we're unlocking mutexes and keeping the vibes immaculate πŸ’–

✨ NAME ✨

std::timed_mutex::unlock β€” yes, that's the name, it's giving "the unlock function for std::timed_mutex" and we're obsessed πŸŽ€

πŸ“œ Synopsis

void unlock();  (since C++11)

Unlocks the mutex. simple as that, no cap ✨

The mutex must be locked by the current thread of execution, otherwise, the behavior is undefined. like, do not freestyle this one, bestie 😭 that's the undefined-behavior zone πŸ’€

This operation synchronizes-with (as defined in std::memory_order) any subsequent lock operation that obtains ownership of the same mutex. yes queen, memory-ordering lore 🧚

🧾 Parameters

(none) β€” zero parameters, not a single one, we love a low-maintenance icon πŸ’…

🎁 Return value

(none) β€” it returns nothing, because the unlock is the moment, periodt πŸ’–

🚨 Exceptions

Throws nothing. literally nothing. not even a little throw. slay 🫢

πŸ“ Notes

unlock() is usually not called directly: std::unique_lock and std::lock_guard are used to manage exclusive locking. so like, yes you can call it, but the cool kids let the manager besties handle it πŸ’…

πŸ§ͺ Example

This section is incomplete Reason: no example

not me finding an incomplete Example section πŸ’€ bestie we have no example, it's giving "todo" but make it iconic 😭

πŸ‘€ 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)
  • try_lock_for β€” tries to lock the mutex, returns if the mutex has been unavailable for the specified timeout duration (public member function)
  • try_lock_until β€” tries to lock the mutex, returns if the mutex has been unavailable until specified time point has been reached (public member function)
  • C documentation for mtx_unlock β€” the C side of the story, iykyk

πŸ—‚οΈ Category

  • Todo no example

big kiss to http://cppreference.com β€” source/version and date 2024.06.10, plus the std::timed_mutex::unlock(3) footer energy β€” byeeeeee πŸ’–πŸ¦‹

πŸ“¦ where this page comes from