4 #define JOB_TYPE_NONE 0
5 #define JOB_TYPE_ANY -1
7 void worker_init(void);
8 void worker_exit(void);
11 * @type: JOB_TYPE_* (>0)
12 * @job_cb: does the job
13 * @free_cb: frees @data
14 * @data: data for the callbacks
16 void worker_add_job(int type
, void (*job_cb
)(void *data
),
17 void (*free_cb
)(void *data
), void *data
);
20 * @type: job type. >0, use JOB_TYPE_ANY to remove all
22 void worker_remove_jobs(int type
);
25 * @type: type of this job
29 * long jobs should call this to see whether it should cancel
30 * call from job function _only_
32 int worker_cancelling(void);