repo.or.cz
/
trinity.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
use usleep for <1s sleeps
[trinity.git]
/
locks.c
blob
d280be9f23d6fbb585a9e9e3c55c577f25831d7f
1
#include <unistd.h>
2
#include
"locks.h"
3
4
void
acquire
(
lock_t
*
lock
)
5
{
6
while
(*
lock
==
LOCKED
)
7
usleep
(
1
);
8
9
*
lock
=
LOCKED
;
10
}
11
12
void
release
(
lock_t
*
lock
)
13
{
14
*
lock
=
UNLOCKED
;
15
}