6 struct workqueue_work {
7 struct flist_head list;
10 typedef void (workqueue_fn)(struct thread_data *, struct workqueue_work *);
13 unsigned int max_workers;
15 struct thread_data *td;
19 struct submit_worker *workers;
20 unsigned int next_free_worker;
22 pthread_cond_t flush_cond;
23 pthread_mutex_t flush_lock;
24 pthread_mutex_t stat_lock;
25 volatile int wake_idle;
28 int workqueue_init(struct thread_data *td, struct workqueue *wq, workqueue_fn *fn, unsigned int max_workers);
29 void workqueue_exit(struct workqueue *wq);
31 bool workqueue_enqueue(struct workqueue *wq, struct workqueue_work *work);
32 void workqueue_flush(struct workqueue *wq);