Skip to content

named_mutex lock

Alairion edited this page May 8, 2021 · 4 revisions

Functions

(1) void lock();
  1. Locks the mutex. If another thread has already locked the mutex, a call to lock will block execution until the lock is acquired.

Parameters

None.

Return value

  1. None.

Preconditions

  1. The calling thread must not own the mutex.

Exceptions

  1. Throws a std::runtime_error if the lock operation fails.

Implementation details

  1. On Windows, calls WaitForSingleObject
    On Posix systems, calls pthread_mutex_lock
Clone this wiki locally