source: flair-src/trunk/lib/FlairCore/src/Semaphore.cpp@ 180

Last change on this file since 180 was 126, checked in by Thomas Fuhrmann, 7 years ago

Add timed semaphore and bool return

File size: 988 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// 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
21using std::string;
22
23namespace flair {
24namespace core {
25
26Semaphore::Semaphore(const Object *parent, uint32_t initialValue, string name)
27 : Object(parent, name, "semaphore") {
28 pimpl_ = new Semaphore_impl(this, initialValue);
29}
30
31Semaphore::~Semaphore() { delete pimpl_; }
32
33bool Semaphore::GetSemaphore(Time timeout) const { return pimpl_->GetSemaphore(timeout); }
34
35bool Semaphore::ReleaseSemaphore(void) const { return pimpl_->ReleaseSemaphore(); }
36
37} // end namespace core
38} // end namespace flair
Note: See TracBrowser for help on using the repository browser.