source: flair-src/trunk/lib/FlairCore/src/unexported/Semaphore_impl.h@ 203

Last change on this file since 203 was 203, checked in by Bayard Gildas, 4 years ago

Added timeout on SharedMem Read

File size: 911 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;
25class Object;
26}
27}
28
29class Semaphore_impl {
30public:
31 Semaphore_impl(flair::core::Semaphore *self, uint32_t initialValue);
32 ~Semaphore_impl();
33 bool TryGetSemaphore();
34 bool GetSemaphore(flair::core::Time timeout = TIME_INFINITE);
35 bool ReleaseSemaphore(void);
36#ifdef __XENO__
37 RT_SEM semaphore;
38#else
39 sem_t semaphore;
40#endif
41
42private:
43 flair::core::Semaphore *self;
44};
45
46#endif // SEMAPHORE_IMPL_H
Note: See TracBrowser for help on using the repository browser.