function
<mutex>

std::swap (unique_lock)

template <class Mutex>void swap (unique_lock<Mutex>& x, unique_lock<Mutex>& y) noexcept;
Swap locks
Exchanges the state of the unique_lock objects x and y.

This is an overload of swap that behaves as if x.swap(y) was called.

Parameters

x,y
unique_lock objects to swap.

Return value

none

Data races

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

Exception safety

No-throw guarantee: never throws exceptions.

See also