COSA
An Object-Oriented Platform for Arduino Programming
Nucleo::Semaphore Class Reference

#include <Semaphore.hh>

Collaboration diagram for Nucleo::Semaphore:
Collaboration graph

Public Member Functions

 Semaphore (uint8_t count=1)
 
void wait (uint8_t count=1)
 
void signal (uint8_t count=1, bool flag=true)
 

Detailed Description

The Cosa Nucleo Semaphore; counting synchronization primitive.

Definition at line 32 of file Semaphore.hh.

Constructor & Destructor Documentation

Nucleo::Semaphore::Semaphore ( uint8_t  count = 1)
inline

Construct and initiate semaphore with given counter.

Parameters
[in]countinitial semaphore value (Default mutex, 1).

Definition at line 38 of file Semaphore.hh.

Member Function Documentation

void Semaphore::signal ( uint8_t  count = 1,
bool  flag = true 
)

Signal release of given count. Waiting thread is resumed after running thread has completed/yield.

Parameters
[in]countreleased (Default mutex, 1).
[in]flagresume waiting thread (Default true).

Definition at line 40 of file Semaphore.cpp.

void Semaphore::wait ( uint8_t  count = 1)

Wait for required count. Threads are queued until count is available.

Parameters
[in]countrequested count (Default mutex, 1).

Definition at line 27 of file Semaphore.cpp.


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