embed server address, not other end's address
[fio.git] / workqueue.h
CommitLineData
a9da8ab2
JA
1#ifndef FIO_RATE_H
2#define FIO_RATE_H
3
4#include "flist.h"
5
6typedef void (workqueue_fn)(struct thread_data *, struct io_u *);
7
8struct 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
23int workqueue_init(struct thread_data *td, struct workqueue *wq, workqueue_fn *fn, unsigned int max_workers);
24void workqueue_exit(struct workqueue *wq);
25
26int workqueue_enqueue(struct workqueue *wq, struct io_u *io_u);
27void workqueue_flush(struct workqueue *wq);
28
29#endif