src/dird/jobq.c
int jobq_remove(jobq_t *jq, JCR *jcr)
{
   int stat;
   bool found = false;
   jobq_item_t *item;

   Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x\n", jcr->JobId, jcr);
   if (jq->valid != JOBQ_VALID) {
      return EINVAL;
   }

   P(jq->mutex);
   foreach_dlist(item, jq->waiting_jobs) {
      if (jcr == item->jcr) {
         found = true;
         break;
      }
   }
   if (!found) {
      V(jq->mutex);
      Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x not in wait queue\n", jcr->JobId, jcr);
      return EINVAL;
   }

   /* Move item to be the first on the list */
   jq->waiting_jobs->remove(item);
   jq->ready_jobs->prepend(item);
   Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x moved to ready queue\n", jcr->JobId, jcr);

   stat = start_server(jq);

   V(jq->mutex);
   Dmsg0(2300, "Return jobq_remove\n");
   return stat;
}
/*
 *  Remove a job from the job queue. Used only by cancel_job().
 *    jq is a queue that was created with jobq_init
 *    work_item is an element of work
 *
 *   Note, it is "removed" from the job queue.
 *    If you want to cancel it, you need to provide some external means
 *    of doing so (e.g. pthread_kill()).
 */
Remove a job from the job queue. Used only by cancel_job().
jq is a queue that was created with jobq_init
work_item is an element of work

Note, it is "removed" from the job queue.
If you want to cancel it, you need to provide some external means
of doing so ).
Remove a job from the job queue . Used only by cancel_job () . jq is a queue that was created with jobq_init work_item is an element of work Note it is " removed " from the job queue . If you want to cancel it you need to provide some external means of doing so ) .
int jobq_remove(jobq_t *jq, JCR *jcr)
{
   int stat;
   bool found = false;
   jobq_item_t *item;
   Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x\n", jcr->JobId, jcr);
   if (jq->valid != JOBQ_VALID) {
      return EINVAL;
   }
   P(jq->mutex);
   foreach_dlist(item, jq->waiting_jobs) {
      if (jcr == item->jcr) {
         found = true;
         break;
      }
   }
   if (!found) {
      V(jq->mutex);
      Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x not in wait queue\n", jcr->JobId, jcr);
      return EINVAL;
   }
   jq->waiting_jobs->remove(item);
   jq->ready_jobs->prepend(item);
   Dmsg2(2300, "jobq_remove jobid=%d jcr=0x%x moved to ready queue\n", jcr->JobId, jcr);
   stat = start_server(jq);
   V(jq->mutex);
   Dmsg0(2300, "Return jobq_remove\n");
   return stat;
}
int jobq_remove ( jobq_t * jq , JCR * jcr ) { int stat ; bool found = false ; jobq_item_t * item ; Dmsg2 ( 2300 , " \n " , jcr -> JobId , jcr ) ; if ( jq -> valid != JOBQ_VALID ) { return EINVAL ; } P ( jq -> mutex ) ; foreach_dlist ( item , jq -> waiting_jobs ) { if ( jcr == item -> jcr ) { found = true ; break ; } } if ( ! found ) { V ( jq -> mutex ) ; Dmsg2 ( 2300 , " \n " , jcr -> JobId , jcr ) ; return EINVAL ; } jq -> waiting_jobs -> remove ( item ) ; jq -> ready_jobs -> prepend ( item ) ; Dmsg2 ( 2300 , " \n " , jcr -> JobId , jcr ) ; stat = start_server ( jq ) ; V ( jq -> mutex ) ; Dmsg0 ( 2300 , " \n " ) ; return stat ; }
Remove a job from the job queue.
Remove a job from the job queue .
/* Move item to be the first on the list */