[jobqueue] add li_job_stop

personal/stbuehler/wip
Stefan Bühler 11 years ago
parent f7730910ad
commit 9bf335c121
  1. 1
      include/lighttpd/jobqueue.h
  2. 15
      src/common/jobqueue.c

@ -42,6 +42,7 @@ LI_API void li_job_queue_clear(liJobQueue *jq); /* runs until all jobs are done
LI_API void li_job_init(liJob *job, liJobCB callback);
LI_API void li_job_reset(liJob *job);
LI_API void li_job_stop(liJob *job); /* remove job from queue if active and detach references */
LI_API void li_job_clear(liJob *job);
/* marks the job for later execution */

@ -128,6 +128,21 @@ void li_job_reset(liJob *job) {
}
}
void li_job_stop(liJob *job) {
if (NULL != job->link.data) {
liJobQueue *jq = job->link.data;
g_queue_unlink(&jq->queue, &job->link);
job->link.data = NULL;
}
if (NULL != job->ref) {
job->ref->job = NULL;
li_job_ref_release(job->ref);
job->ref = NULL;
}
}
void li_job_clear(liJob *job) {
if (NULL != job->link.data) {
liJobQueue *jq = job->link.data;

Loading…
Cancel
Save