explicit scoped_lock( MutexTypes&... m );
scoped_lock( std::adopt_lock_t, MutexTypes&... m );
scoped_lock( const scoped_lock& ) = delete;
Acquires ownership of the given mutexes
sizeof...(MutexTypes) == 0, does nothing. Otherwise, if
sizeof...(MutexTypes) == 1, effectively calls
m.lock(). Otherwise, effectively calls
m...without attempting to lock any of them. The behavior is undefined unless the current thread holds a non-shared lock (i.e., a lock acquired by
try_lock_until) on each object in
The behavior is undefined if
m is destroyed before the
scoped_lock object is.
|m||-||mutexes to acquire ownership of|
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
|DR||Applied to||Behavior as published||Correct behavior|
|P0739R0||C++17|| ||moved to first|
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.