source: flair-src/branches/semaphore/lib/FlairCore/src/unexported/Semaphore_impl.h@ 117

Last change on this file since 117 was 117, checked in by Thomas Fuhrmann, 6 years ago

Add a semaphore class

File size: 834 bytes
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5/*!
6 * \file Semaphore_impl.h
7 * \brief Class defining a semaphore implementation
8 * \author Thomas Fuhrmann, Copyright Heudiasyc UMR UTC/CNRS 7253
9 * \date 2016/11/16
10 * \version 1.0
11 */
12
13#ifndef SEMAPHORE_IMPL_H
14#define SEMAPHORE_IMPL_H
15
16#ifdef __XENO__
17#include <native/sem.h>
18#else
19#include <semaphore.h>
20#endif
21
22namespace flair {
23namespace core {
24class Semaphore;
25}
26}
27
28class Semaphore_impl {
29public:
30 Semaphore_impl(flair::core::Semaphore *self, uint32_t initialValue);
31 ~Semaphore_impl();
32 void GetSemaphore(void);
33 void ReleaseSemaphore(void);
34#ifdef __XENO__
35 RT_SEM semaphore;
36#else
37 sem_t semaphore;
38#endif
39
40private:
41 flair::core::Semaphore *self;
42};
43
44#endif // SEMAPHORE_IMPL_H
Note: See TracBrowser for help on using the repository browser.