RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sem.h
Go to the documentation of this file.
1 /*
2  The Real-Time eXperiment Interface (RTXI)
3  Copyright (C) 2011 Georgia Institute of Technology, University of Utah, Weill Cornell Medical College
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 */
19 
20 #ifndef SEM_H
21 #define SEM_H
22 
23 #include <unistd.h>
24 
25 class Semaphore
26 {
27 
28 public:
29 
30  Semaphore(size_t n =0);
31  ~Semaphore(void);
32 
33  void down(void);
34  void up(void);
35  int value(void);
36 
37 private:
38 
39  int count;
40 
41 }; // class Semaphore
42 
43 #endif // SEM_H
void down(void)
Definition: sem.cpp:28
void up(void)
Definition: sem.cpp:43
int value(void)
Definition: sem.cpp:48
Semaphore(size_t n=0)
Definition: sem.cpp:24
~Semaphore(void)
Definition: sem.cpp:26
Definition: sem.h:25
int count
Definition: sem.h:39