OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::co::semaphore Class Referencefinal

A Co-Routine Semaphore. More...

#include <coroutine.hpp>

Public Member Functions

 semaphore (size_t init)
 Initializes a coroutine semaphore with a value for the counter. Internally, the semaphores use an size_t to represent the counter, therefore the init argument should be within range of this type.
 
void set (size_t val) noexcept
 Set the coroutine semaphore with a value for the counter. Internally, the semaphores use an size_t to represent the counter, therefore the val argument should be within range of this type.
 

Detailed Description

A Co-Routine Semaphore.

Constructor & Destructor Documentation

◆ semaphore()

qOS::co::semaphore::semaphore ( size_t init)
inlineexplicit

Initializes a coroutine semaphore with a value for the counter. Internally, the semaphores use an size_t to represent the counter, therefore the init argument should be within range of this type.

See also
co::semWait()
co::semSignal()
Parameters
[in]initThe initial count of the semaphore.

Member Function Documentation

◆ set()

void qOS::co::semaphore::set ( size_t val)
noexcept

Set the coroutine semaphore with a value for the counter. Internally, the semaphores use an size_t to represent the counter, therefore the val argument should be within range of this type.

See also
co::semWait()
co::semSignal()
Parameters
[in]valThe initial count of the semaphore.