Last change
on this file was 238, checked in by Bayard Gildas, 7 years ago |
correction sémaphore. bloquant tout ça...
|
File size:
1.0 KB
|
Rev | Line | |
---|
[117] | 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
|
---|
[238] | 19 | #include <fcntl.h>
|
---|
[117] | 20 | #include <semaphore.h>
|
---|
| 21 | #endif
|
---|
| 22 |
|
---|
| 23 | namespace flair {
|
---|
| 24 | namespace core {
|
---|
| 25 | class Semaphore;
|
---|
[127] | 26 | class Object;
|
---|
[117] | 27 | }
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | class Semaphore_impl {
|
---|
| 31 | public:
|
---|
[238] | 32 | Semaphore_impl(flair::core::Semaphore *self, std::string name, uint32_t initialValue, flair::core::Semaphore::Type &type);
|
---|
[117] | 33 | ~Semaphore_impl();
|
---|
[203] | 34 | bool TryGetSemaphore();
|
---|
[127] | 35 | bool GetSemaphore(flair::core::Time timeout = TIME_INFINITE);
|
---|
| 36 | bool ReleaseSemaphore(void);
|
---|
[117] | 37 | #ifdef __XENO__
|
---|
| 38 | RT_SEM semaphore;
|
---|
| 39 | #else
|
---|
[238] | 40 | std::string sem_name;
|
---|
| 41 | sem_t *semaphore;
|
---|
[117] | 42 | #endif
|
---|
| 43 |
|
---|
| 44 | private:
|
---|
| 45 | flair::core::Semaphore *self;
|
---|
[238] | 46 | flair::core::Semaphore::Type type;
|
---|
[117] | 47 | };
|
---|
| 48 |
|
---|
| 49 | #endif // SEMAPHORE_IMPL_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.