version 1.23, 2011/01/23 11:03:43 |
version 1.24, 2011/01/26 00:11:47 |
|
|
*/ |
*/ |
|
|
/* All jobs list. */ |
/* All jobs list. */ |
struct joblist all_jobs = SLIST_HEAD_INITIALIZER(all_jobs); |
struct joblist all_jobs = LIST_HEAD_INITIALIZER(all_jobs); |
|
|
RB_GENERATE(jobs, job, entry, job_cmp); |
RB_GENERATE(jobs, job, entry, job_cmp); |
|
|
|
|
|
|
if (jobs != NULL) |
if (jobs != NULL) |
RB_INSERT(jobs, jobs, job); |
RB_INSERT(jobs, jobs, job); |
SLIST_INSERT_HEAD(&all_jobs, job, lentry); |
LIST_INSERT_HEAD(&all_jobs, job, lentry); |
|
|
return (job); |
return (job); |
} |
} |
|
|
{ |
{ |
job_kill(job); |
job_kill(job); |
|
|
SLIST_REMOVE(&all_jobs, job, job, lentry); |
LIST_REMOVE(job, lentry); |
xfree(job->cmd); |
xfree(job->cmd); |
|
|
if (job->freefn != NULL && job->data != NULL) |
if (job->freefn != NULL && job->data != NULL) |