pthread_cancel(thread);
pthread_join(thread, NULL);
}
+ /* avoid later execution of a cancelled job */
+ this->callback = NULL;
}
/**
pthread_cleanup_push((void*)destroy, this);
while (TRUE)
{
+ if (this->callback == NULL)
+ {
+ cleanup = TRUE;
+ break;
+ }
switch (this->callback(this->data))
{
case JOB_REQUEUE_DIRECT:
continue;
case JOB_REQUEUE_FAIR:
{
- this->thread = 0;
charon->processor->queue_job(charon->processor,
&this->public.job_interface);
break;
case JOB_REQUEUE_NONE:
default:
{
- this->thread = 0;
cleanup = TRUE;
break;
}
}
break;
}
+ this->thread = 0;
unregister(this);
pthread_cleanup_pop(cleanup);
}