Documentation Home >> Headers >> <mutex> Header >> std::recursive_timed_mutex >> std::recursive_timed_mutex::lock Member Function

Acquires a lock on a std::recursive_timed_mutex object for the current thread.

void lock();

Preconditions:

The calling thread must not hold a lock on *this.

Effects:

Blocks the current thread until a lock on *this can be obtained.

Postconditions:

*this is locked by the calling thread. If the calling thread already held a lock on *this, the lock count is increased by one.

Throws:

An exception of type std::system_error if an error occurs.

Header

#include <mutex>

See Also