#include "flist.h"
-typedef void (workqueue_fn)(struct thread_data *, struct io_u *);
+struct workqueue_work {
+ struct flist_head list;
+};
+
+typedef void (workqueue_fn)(struct thread_data *, struct workqueue_work *);
struct workqueue {
unsigned int max_workers;
pthread_cond_t flush_cond;
pthread_mutex_t flush_lock;
+ pthread_mutex_t stat_lock;
volatile int wake_idle;
};
int workqueue_init(struct thread_data *td, struct workqueue *wq, workqueue_fn *fn, unsigned int max_workers);
void workqueue_exit(struct workqueue *wq);
-int workqueue_enqueue(struct workqueue *wq, struct io_u *io_u);
+bool workqueue_enqueue(struct workqueue *wq, struct workqueue_work *work);
void workqueue_flush(struct workqueue *wq);
#endif