public member function


default (1)
constexpr mutex() noexcept;
copy [deleted] (2)
mutex (const mutex&) = delete;
Construct mutex
Constructs a mutex object.

The object is in an unlocked state.

mutex objects cannot be copied/moved (both the copy constructor and assignment operator are deleted for this type).



Data races

The construction of mutex is not atomic itself: Accessing the object while being constructed may initiate a data race.

Exception safety

No-throw guarantee: never throws exceptions.

See also