For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
|adopt_lock Variable||call_once Function||defer_lock Variable|
|lock Function||try_to_lock Variable|
Provides a mechanism for calling a specified callable object exactly once during execution.
template <class Callable, class... Args> void call_once(once_flag& Flag, Callable F&&, Args&&... A);
A once_flag object that ensures that the callable object is only called once.
A callable object.
An argument list.
Flag is not valid, the function throws a system_error that has an error code of
invalid_argument. Otherwise, the template function uses its
Flag argument to ensure that it calls
F(A...) successfully exactly once, regardless of how many times the template function is called. If
F(A...) exits by throwing an exception, the call was not successful.
Represents an object that can be passed to the constructor for unique_lock. This indicates that the constructor should not lock the mutex object that's also being passed to it.
Attempts to lock all arguments without deadlock.
The arguments to the template function must be mutex types, except that calls to
try_lock might throw exceptions.
The function locks all of its arguments without deadlock by calls to
unlock. If a call to
try_lock throws an exception, the function calls
unlock on any of the mutex objects that were successfully locked before rethrowing the exception.
Represents an object that can be passed to the constructor for unique_lock to indicate that the constructor should try to unlock the
mutex that is also being passed to it without blocking.