<mutex>

public member function
<mutex>

std::unique_lock::swap

void swap (unique_lock& x) noexcept;
Swap unique locks
Exchanges contents with x, including both the managed mutex objects and their current owning states.

Parameters

x
Another unique_lock object.

Return value

none

Data races

Both x and the object are modified.
Neither managed mutex object is accessed by the operation.

Exception safety

No-throw guarantee: never throws exceptions.

See also