Bail out if glfs_creat failed
[fio.git] / tp.h
CommitLineData
aee2ab67
JA
1#ifndef FIO_TP_H
2#define FIO_TP_H
3
4#include "flist.h"
5
6struct tp_work;
7typedef int (tp_work_fn)(struct tp_work *);
8
9struct tp_work {
10 struct flist_head list;
11 tp_work_fn *fn;
12 int wait;
13 pthread_cond_t cv;
14 pthread_mutex_t lock;
15 volatile int done;
16};
17
18struct tp_data {
19 pthread_t thread;
20 pthread_cond_t cv;
21 pthread_mutex_t lock;
22 struct flist_head work;
23 volatile int thread_exit;
24 pthread_cond_t sleep_cv;
25 volatile int sleeping;
26};
27
28extern void tp_init(struct tp_data **);
29extern void tp_exit(struct tp_data **);
30extern void tp_queue_work(struct tp_data *, struct tp_work *);
31
32#endif