Last change
on this file since 126 was 126, checked in by Thomas Fuhrmann, 6 years ago |
Add timed semaphore and bool return
|
File size:
988 bytes
|
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 | // created: 2016/11/16
|
---|
| 6 | // filename: Semaphore.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: Thomas Fuhrmann
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Class defining a semaphore
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 |
|
---|
| 18 | #include "Semaphore.h"
|
---|
| 19 | #include "Semaphore_impl.h"
|
---|
| 20 |
|
---|
| 21 | using std::string;
|
---|
| 22 |
|
---|
| 23 | namespace flair {
|
---|
| 24 | namespace core {
|
---|
| 25 |
|
---|
| 26 | Semaphore::Semaphore(const Object *parent, uint32_t initialValue, string name)
|
---|
| 27 | : Object(parent, name, "semaphore") {
|
---|
| 28 | pimpl_ = new Semaphore_impl(this, initialValue);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | Semaphore::~Semaphore() { delete pimpl_; }
|
---|
| 32 |
|
---|
[126] | 33 | bool Semaphore::GetSemaphore(Time timeout) const { return pimpl_->GetSemaphore(timeout); }
|
---|
[117] | 34 |
|
---|
[126] | 35 | bool Semaphore::ReleaseSemaphore(void) const { return pimpl_->ReleaseSemaphore(); }
|
---|
[117] | 36 |
|
---|
| 37 | } // end namespace core
|
---|
| 38 | } // end namespace flair
|
---|
Note:
See
TracBrowser
for help on using the repository browser.