-/*
- * This is a pretty crappy semaphore implementation, but with the use that fio
- * has (just signalling start/go conditions), it doesn't have to be better.
- * Naturally this would not work for any type of contended semaphore or
- * for real locking.
- */
-static inline void fio_sem_init(volatile int *sem, int val)
-{
- *sem = val;
-}
-
-static inline void fio_sem_down(volatile int *sem)
-{
- while (*sem == 0)
- usleep(10000);
-
- (*sem)--;
-}
-
-static inline void fio_sem_up(volatile int *sem)
-{
- (*sem)++;
-}
-