Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
semset.h
1
2
/***************************************************************************
3
* semset.h - IPC semaphore set
4
*
5
* Generated: Tue Sep 19 14:45:47 2006
6
* Copyright 2006 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef __UTILS_IPC_SEMSET_H_
25
#define __UTILS_IPC_SEMSET_H_
26
27
namespace
fawkes {
28
29
30
class
SemaphoreSetData;
31
32
class
SemaphoreSet
{
33
public
:
34
35
SemaphoreSet
(
const
char
*path,
char
id
,
36
int
num_sems,
37
bool
create =
false
,
38
bool
destroy_on_delete
=
false
);
39
40
SemaphoreSet
(
int
key
,
41
int
num_sems,
42
bool
create =
false
,
43
bool
destroy_on_delete
=
false
);
44
45
SemaphoreSet
(
int
num_sems,
46
bool
destroy_on_delete
=
false
);
47
48
~SemaphoreSet
();
49
50
bool
valid
();
51
void
lock
(
unsigned
short
sem_num = 0,
short
num = 1);
52
bool
try_lock
(
unsigned
short
sem_num = 0,
short
num = 1);
53
void
unlock
(
unsigned
short
sem_num = 0,
short
num = -1);
54
void
set_value
(
int
sem_num,
int
val);
55
int
get_value
(
int
sem_num);
56
int
key
();
57
void
set_destroy_on_delete
(
bool
destroy
);
58
59
static
int
free_key
();
60
static
void
destroy
(
int
key);
61
62
protected
:
63
bool
destroy_on_delete
;
64
65
private
:
66
SemaphoreSetData *data;
67
68
};
69
70
71
}
// end namespace fawkes
72
73
#endif
src
libs
utils
ipc
semset.h
Generated by
1.8.1.1