repo.or.cz
/
cinelerra_cv
/
mob.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git]
/
hvirtual
/
guicast
/
condition.h
blob
d96951d0b79825044a5d6a20a5bdd7e000a0dbbd
1
#ifndef CONDITION_H
2
#define CONDITION_H
3
4
#include <pthread.h>
5
6
class
Condition
7
{
8
public
:
9
Condition
(
int
init_value
=
0
);
10
~
Condition
();
11
12
// Block if value <= 0, then decrease value
13
void
lock
();
14
// Increase value
15
void
unlock
();
16
int
timed_lock
(
int
milliseconds
);
17
18
pthread_cond_t cond
;
19
pthread_mutex_t mutex
;
20
int
value
;
21
};
22
23
24
#endif