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
r419: various fixes, memory allocations, etc.
[cinelerra_cv/mob.git]
/
guicast
/
bccounter.C
blob
bb3b98ab3ff7c677f6c4189ceeda836c6259e602
1
#include "bccounter.h"
2
#include "mutex.h"
3
4
BCCounter::BCCounter()
5
{
6
value = 0;
7
mutex = new Mutex;
8
}
9
10
BCCounter::~BCCounter()
11
{
12
delete mutex;
13
}
14
15
void BCCounter::up()
16
{
17
mutex->lock("BCCounter::up");
18
value++;
19
printf("BCCounter::up %p %d\n", this, value);
20
mutex->unlock();
21
}
22
23
void BCCounter::down()
24
{
25
mutex->lock("BCCounter::down");
26
value--;
27
printf("BCCounter::down %p %d\n", this, value);
28
mutex->unlock();
29
}