Files
2025-10-25 03:02:53 +03:00

12 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[mutex.syn]
# 32 Concurrency support library [[thread]](./#thread)
## 32.6 Mutual exclusion [[thread.mutex]](thread.mutex#mutex.syn)
### 32.6.2 Header <mutex> synopsis [mutex.syn]
[🔗](#header:%3cmutex%3e)
namespace std {// [[thread.mutex.class]](thread.mutex.class "32.6.4.2.2Class mutex"), class mutexclass mutex; // [[thread.mutex.recursive]](thread.mutex.recursive "32.6.4.2.3Class recursive_­mutex"), class recursive_mutexclass recursive_mutex; // [[thread.timedmutex.class]](thread.timedmutex.class "32.6.4.3.2Class timed_­mutex"), class timed_mutexclass timed_mutex; // [[thread.timedmutex.recursive]](thread.timedmutex.recursive "32.6.4.3.3Class recursive_­timed_­mutex"), class recursive_timed_mutexclass recursive_timed_mutex; struct defer_lock_t { explicit defer_lock_t() = default; }; struct try_to_lock_t { explicit try_to_lock_t() = default; }; struct adopt_lock_t { explicit adopt_lock_t() = default; }; inline constexpr defer_lock_t defer_lock { }; inline constexpr try_to_lock_t try_to_lock { }; inline constexpr adopt_lock_t adopt_lock { }; // [[thread.lock]](thread.lock "32.6.5Locks"), lockstemplate<class Mutex> class lock_guard; template<class... MutexTypes> class scoped_lock; template<class Mutex> class unique_lock; template<class Mutex>void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) noexcept; // [[thread.lock.algorithm]](thread.lock.algorithm "32.6.6Generic locking algorithms"), generic locking algorithmstemplate<class L1, class L2, class... L3> int try_lock(L1&, L2&, L3&...); template<class L1, class L2, class... L3> void lock(L1&, L2&, L3&...); struct once_flag; template<class Callable, class... Args>void call_once(once_flag& flag, Callable&& func, Args&&... args);}