[mutex.syn] # 32 Concurrency support library [[thread]](./#thread) ## 32.6 Mutual exclusion [[thread.mutex]](thread.mutex#mutex.syn) ### 32.6.2 Header synopsis [mutex.syn] [🔗](#header:%3cmutex%3e) namespace std {// [[thread.mutex.class]](thread.mutex.class "32.6.4.2.2 Class mutex"), class mutexclass mutex; // [[thread.mutex.recursive]](thread.mutex.recursive "32.6.4.2.3 Class recursive_­mutex"), class recursive_mutexclass recursive_mutex; // [[thread.timedmutex.class]](thread.timedmutex.class "32.6.4.3.2 Class timed_­mutex"), class timed_mutexclass timed_mutex; // [[thread.timedmutex.recursive]](thread.timedmutex.recursive "32.6.4.3.3 Class 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.5 Locks"), lockstemplate class lock_guard; template class scoped_lock; template class unique_lock; templatevoid swap(unique_lock& x, unique_lock& y) noexcept; // [[thread.lock.algorithm]](thread.lock.algorithm "32.6.6 Generic locking algorithms"), generic locking algorithmstemplate int try_lock(L1&, L2&, L3&...); template void lock(L1&, L2&, L3&...); struct once_flag; templatevoid call_once(once_flag& flag, Callable&& func, Args&&... args);}