blob: 85f5f69cee0724069d60d72d9761e2cfc19efccd [file] [log] [blame]
Jens Axboe07739b52007-03-08 20:25:46 +01001#ifndef FIO_MUTEX_H
2#define FIO_MUTEX_H
3
4#include <pthread.h>
5
Jens Axboecdd18ad2008-02-27 18:58:00 +01006struct fio_mutex {
Jens Axboe07739b52007-03-08 20:25:46 +01007 pthread_mutex_t lock;
8 pthread_cond_t cond;
9 unsigned int value;
10
Jens Axboecdd18ad2008-02-27 18:58:00 +010011 int mutex_fd;
Jens Axboe07739b52007-03-08 20:25:46 +010012};
13
Jens Axboecdd18ad2008-02-27 18:58:00 +010014extern struct fio_mutex *fio_mutex_init(int);
15extern void fio_mutex_remove(struct fio_mutex *);
16extern inline void fio_mutex_down(struct fio_mutex *);
17extern inline void fio_mutex_up(struct fio_mutex *);
Jens Axboe07739b52007-03-08 20:25:46 +010018
19#endif