Search:
Reference
<mutex>
unique_lock
swap
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
unique_lock::unique_lock
Construct unique_lock
(public member function )
unique_lock::operator=
Move-assign unique_lock
(public member function )
C++
Information
Tutorials
Reference
Articles
Forum
Reference
C library:
<cassert> (assert.h)
<cctype> (ctype.h)
<cerrno> (errno.h)
<cfenv> (fenv.h)
<cfloat> (float.h)
<cinttypes> (inttypes.h)
<ciso646> (iso646.h)
<climits> (limits.h)
<clocale> (locale.h)
<cmath> (math.h)
<csetjmp> (setjmp.h)
<csignal> (signal.h)
<cstdarg> (stdarg.h)
<cstdbool> (stdbool.h)
<cstddef> (stddef.h)
<cstdint> (stdint.h)
<cstdio> (stdio.h)
<cstdlib> (stdlib.h)
<cstring> (string.h)
<ctgmath> (tgmath.h)
<ctime> (time.h)
<cuchar> (uchar.h)
<cwchar> (wchar.h)
<cwctype> (wctype.h)
Containers:
<array>
<deque>
<forward_list>
<list>
<map>
<queue>
<set>
<stack>
<unordered_map>
<unordered_set>
<vector>
Input/Output:
<fstream>
<iomanip>
<ios>
<iosfwd>
<iostream>
<istream>
<ostream>
<sstream>
<streambuf>
Multi-threading:
<atomic>
<condition_variable>
<future>
<mutex>
<thread>
Other:
<algorithm>
<bitset>
<chrono>
<codecvt>
<complex>
<exception>
<functional>
<initializer_list>
<iterator>
<limits>
<locale>
<memory>
<new>
<numeric>
<random>
<ratio>
<regex>
<stdexcept>
<string>
<system_error>
<tuple>
<typeindex>
<typeinfo>
<type_traits>
<utility>
<valarray>
<mutex>
classes:
adopt_lock_t
defer_lock_t
lock_guard
mutex
once_flag
recursive_mutex
recursive_timed_mutex
timed_mutex
try_to_lock_t
unique_lock
functions:
call_once
lock
try_lock
constants:
adopt_lock
defer_lock
try_to_lock
unique_lock
unique_lock::unique_lock
unique_lock::~unique_lock
member functions:
unique_lock::lock
unique_lock::mutex
unique_lock::operator=
unique_lock::operator bool
unique_lock::owns_lock
unique_lock::release
unique_lock::swap
unique_lock::try_lock
unique_lock::try_lock_for
unique_lock::try_lock_until
unique_lock::unlock
non-member overloads:
swap (unique_lock)