Beamlib  3.0.1
This is the Beam C++ class library.
BCond.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * BCond.h BCond Classes
3  * T.Barnaby, BEAM Ltd, 15/11/02
4  * Copyright (c) 2012 All Right Reserved, Beam Ltd, http://www.beam.ltd.uk
5  *******************************************************************************
6  *
7  * For license see LICENSE.txt at the root of the beamlib source tree.
8  */
9 #ifndef BCOND_H
10 #define BCOND_H 1
11 
12 #include <pthread.h>
13 
15 class BCond {
16 public:
17  BCond();
18  ~BCond();
19 
20  int signal(); // Signal the condition. Unblock all threads waiting on condition
21  int wait(); // Wait for contition
22  int timedWait(int timeOutUs); // Wait for the condition, with timeout
23 private:
24  pthread_mutex_t omutex;
25  pthread_cond_t ocond;
26 };
27 
28 #endif
Thread safe conditional variable.
Definition: BCond.h:15
BCond()
Definition: BCond.cpp:12
int timedWait(int timeOutUs)
Definition: BCond.cpp:35
int signal()
Definition: BCond.cpp:22
~BCond()
Definition: BCond.cpp:17
int wait()
Definition: BCond.cpp:26