uvw 2.12.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uvw::Semaphore Class Referencefinal

The Semaphore wrapper. More...

#include <thread.h>

Inheritance diagram for uvw::Semaphore:
Inheritance graph
[legend]
Collaboration diagram for uvw::Semaphore:
Collaboration graph
[legend]

Public Member Functions

void post () noexcept
 Unlocks a semaphore.
 
void wait () noexcept
 Locks a semaphore.
 
bool tryWait () noexcept
 Tries to lock a semaphore. More...
 
- Public Member Functions inherited from uvw::UnderlyingType< Semaphore, uv_sem_t >
Looploop () const noexcept
 Gets the loop from which the resource was originated. More...
 
const uv_sem_t * raw () const noexcept
 Gets the underlying raw data structure. More...
 
uv_sem_t * raw () noexcept
 Gets the underlying raw data structure. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from uvw::UnderlyingType< Semaphore, uv_sem_t >
static std::shared_ptr< Semaphorecreate (Args &&...args)
 Creates a new resource of the given type. More...
 

Detailed Description

The Semaphore wrapper.

To create a Semaphore through a Loop, arguments follow:

Definition at line 248 of file thread.h.

Member Function Documentation

◆ tryWait()

bool uvw::Semaphore::tryWait ( )
noexcept

Tries to lock a semaphore.

Returns
True in case of success, false otherwise.

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