Add a semaphore implementation
[fio.git] / sem.h
diff --git a/sem.h b/sem.h
new file mode 100644 (file)
index 0000000..a7b4664
--- /dev/null
+++ b/sem.h
@@ -0,0 +1,16 @@
+#ifndef FIO_SEM_H
+#define FIO_SEM_H
+
+#include <semaphore.h>
+
+struct fio_sem {
+       sem_t sem;
+       int sem_val;
+};
+
+extern struct fio_sem *fio_sem_init(int);
+extern void fio_sem_remove(struct fio_sem *);
+extern void fio_sem_down(struct fio_sem *);
+extern void fio_sem_up(struct fio_sem *);
+
+#endif