use usleep for <1s sleeps
[trinity.git] / locks.c
blobd280be9f23d6fbb585a9e9e3c55c577f25831d7f
1 #include <unistd.h>
2 #include "locks.h"
4 void acquire(lock_t *lock)
6 while (*lock == LOCKED)
7 usleep(1);
9 *lock = LOCKED;
12 void release(lock_t *lock)
14 *lock = UNLOCKED;