GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::scoped_lock::scoped_lock(3) C++ Standard Libary std::scoped_lock::scoped_lock(3)

std::scoped_lock::scoped_lock - std::scoped_lock::scoped_lock


explicit scoped_lock( MutexTypes&... m ); (1) (since C++17)
scoped_lock( std::adopt_lock_t, MutexTypes&... m ); (2) (since C++17)
scoped_lock( const scoped_lock& ) = delete; (3) (since C++17)


Acquires ownership of the given mutexes m.


1) If sizeof...(MutexTypes) == 0, does nothing. Otherwise, if sizeof...(MutexTypes)
== 1, effectively calls m.lock(). Otherwise, effectively calls std::lock(m...).
2) Acquires ownership of the mutexes 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 lock, try_lock, try_lock_for, or try_lock_until) on each object in
m....
3) Copy constructor is deleted.


The behavior is undefined if m is destroyed before the scoped_lock object is.


m - mutexes to acquire ownership of


1) Throws any exceptions thrown by m.lock()
2) Throws nothing


Defect reports


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 adopt_lock_t parameter was last, impeding class moved to first
template argument deduction

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.