| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes | List of all members
erpc::Semaphore Class Reference
Porting » Threads

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 timeout=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] | count | Semaphore number.

## Member Function Documentation

bool Semaphore::get | ( | uint32_t | timeout = `kWaitForever` | ) |

This function get semaphore.

Parameters

  [in] | timeout | Time how long can wait for getting semaphore.

Return values

  true | When semaphore got successfully.
  false | When 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:

- erpc_threading.h
- erpc_threading_pthreads.cpp
- erpc_threading_win32.cpp