eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc::Semaphore Class Reference

Simple semaphore class. More...

#include <erpc_threading.h>

Public Member Functions

 Semaphore (int count=0)
 Constructor. More...
 
 ~Semaphore (void)
 Destructor.
 
void put (void)
 This function puts semaphore.
 
bool get (uint32_t timeoutUsecs=kWaitForever)
 This function get semaphore. More...
 
int getCount (void) const
 This function returns semaphore count number. More...
 

Static Public Attributes

static const uint32_t kWaitForever
 Variable for semaphore to wait forever.
 

Detailed Description

Simple semaphore class.

Constructor & Destructor Documentation

Semaphore::Semaphore ( int  count = 0)

Constructor.

Parameters
[in]countSemaphore number.

Member Function Documentation

bool Semaphore::get ( uint32_t  timeoutUsecs = kWaitForever)

This function get semaphore.

Parameters
[in]timeoutUsecsTime how long can wait for getting semaphore in [us].
Return values
trueWhen semaphore got successfully.
falseWhen mutex didn't get.
int Semaphore::getCount ( void  ) const

This function returns semaphore count number.

Returns
Semaphore count number.

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