uvw 2.12.1
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 tryLock () noexcept
 Tries to lock the mutex.
void unlock () noexcept
 Unlocks the mutex.
Public Member Functions inherited from uvw::UnderlyingType< Mutex, uv_mutex_t >
Looploop () const noexcept
 Gets the loop from which the resource was originated.
const uv_mutex_t * raw () const noexcept
 Gets the underlying raw data structure.

Additional Inherited Members

Static Public Member Functions inherited from uvw::UnderlyingType< Mutex, uv_mutex_t >
static std::shared_ptr< Mutexcreate (Args &&...args)
 Creates a new resource of the given type.

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 175 of file thread.h.

Member Function Documentation

◆ tryLock()

bool uvw::Mutex::tryLock ( )
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: