Add get_fs_size() support for BSDs
[fio.git] / workqueue.h
1 #ifndef FIO_RATE_H
2 #define FIO_RATE_H
3
4 #include "flist.h"
5
6 typedef void (workqueue_fn)(struct thread_data *, struct io_u *);
7
8 struct workqueue {
9         unsigned int max_workers;
10
11         struct thread_data *td;
12         workqueue_fn *fn;
13
14         uint64_t work_seq;
15         struct submit_worker *workers;
16         unsigned int next_free_worker;
17
18         pthread_cond_t flush_cond;
19         pthread_mutex_t flush_lock;
20         volatile int wake_idle;
21 };
22
23 int workqueue_init(struct thread_data *td, struct workqueue *wq, workqueue_fn *fn, unsigned int max_workers);
24 void workqueue_exit(struct workqueue *wq);
25
26 int workqueue_enqueue(struct workqueue *wq, struct io_u *io_u);
27 void workqueue_flush(struct workqueue *wq);
28
29 #endif