1 /* job.h - a job in the queue */
8 #define JOB_STATE_INVALID 0
9 #define JOB_STATE_READY 1
10 #define JOB_STATE_RESERVED 2
11 #define JOB_STATE_BURIED 3
12 #define JOB_STATE_DELAYED 4
14 typedef struct job
*job
;
17 job prev
, next
; /* linked list of jobs */
18 unsigned long long int id
;
24 unsigned int timeout_ct
;
25 unsigned int release_ct
;
32 job
allocate_job(int body_size
);
33 job
make_job(unsigned int pri
, unsigned int delay
, int body_size
);
35 typedef int(*job_cmp_fn
)(job
, job
);
36 int job_pri_cmp(job a
, job b
);
37 int job_delay_cmp(job a
, job b
);
41 const char * job_state(job j
);
43 int job_list_any_p(job head
);
44 job
job_remove(job j
);
45 void job_insert(job head
, job j
);
47 unsigned long long int total_jobs();