LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
CountingSemaphore.h
1 #ifndef RHESUS_COUNTINGSEMAPHORE_H_
2 #define RHESUS_COUNTINGSEMAPHORE_H_
3 
4 #include "semLib.h"
5 #include "taskLib.h"
6 #include "sysLib.h"
7 
8 namespace Rhesus
9 {
10 namespace Toolkit
11 {
12 namespace Tasks
13 {
14 
20  {
21  public:
25  explicit CountingSemaphore(UINT32 initialcount);
27 
31  void Give();
32 
36  void Take();
37 
41  void Take(INT32 timeout);
42 
46  bool IsEmpty();
47 
51  void Flush();
52 
53  private:
54 #ifdef __VXWORKS__
55  SEM_ID m_sem;
56 #endif
57 
58  };
59 
60 }
61 
62 }
63 
64 }
65 
66 #endif