uvw 3.4.0
Loading...
Searching...
No Matches
uvw::mutex Class Referencefinal

The mutex wrapper. More...

#include <thread.h>

Inheritance diagram for uvw::mutex:
Collaboration diagram for uvw::mutex:

Public Member Functions

void lock () noexcept
 Locks the mutex.
 
bool try_lock () noexcept
 Tries to lock the mutex.
 
void unlock () noexcept
 Unlocks the mutex.
 
- Public Member Functions inherited from uvw::uv_type< uv_mutex_t >
loopparent () const noexcept
 Gets the loop from which the resource was originated.
 
const uv_mutex_t * raw () const noexcept
 Gets the underlying raw data structure.
 
uv_mutex_t * raw () noexcept
 Gets the underlying raw data structure.
 

Detailed Description

The mutex wrapper.

To create a mutex through a loop, arguments follow:

  • An option boolean that specifies if the mutex is a recursive one. The default value is false, the mutex isn't recursive.

Definition at line 183 of file thread.h.

Member Function Documentation

◆ try_lock()

bool uvw::mutex::try_lock ( )
noexcept

Tries to lock the mutex.

Returns
True in case of success, false otherwise.

The documentation for this class was generated from the following file: