src/lib/jcr.c
JCR *jcr_walk_next(JCR *prev_jcr)
{
   JCR *jcr;

   lock_jcr_chain();
   jcr = (JCR *)jcrs->next(prev_jcr);
   if (jcr) {
      jcr->inc_use_count();
      if (jcr->JobId > 0) {
         Dmsg3(dbglvl, "Inc walk_next jid=%u use_count=%d Job=%s\n",
            jcr->JobId, jcr->use_count(), jcr->Job);
      }
   }
   unlock_jcr_chain();
   if (prev_jcr) {
      free_jcr(prev_jcr);
   }
   return jcr;
}
/*
 * Get next jcr from chain, and release current one
 */
Get next jcr from chain, and release current one
Get next jcr from chain and release current one
JCR *jcr_walk_next(JCR *prev_jcr)
{
   JCR *jcr;
   lock_jcr_chain();
   jcr = (JCR *)jcrs->next(prev_jcr);
   if (jcr) {
      jcr->inc_use_count();
      if (jcr->JobId > 0) {
         Dmsg3(dbglvl, "Inc walk_next jid=%u use_count=%d Job=%s\n",
            jcr->JobId, jcr->use_count(), jcr->Job);
      }
   }
   unlock_jcr_chain();
   if (prev_jcr) {
      free_jcr(prev_jcr);
   }
   return jcr;
}
JCR * jcr_walk_next ( JCR * prev_jcr ) { JCR * jcr ; lock_jcr_chain ( ) ; jcr = ( JCR * ) jcrs -> next ( prev_jcr ) ; if ( jcr ) { jcr -> inc_use_count ( ) ; if ( jcr -> JobId > 0 ) { Dmsg3 ( dbglvl , " \n " , jcr -> JobId , jcr -> use_count ( ) , jcr -> Job ) ; } } unlock_jcr_chain ( ) ; if ( prev_jcr ) { free_jcr ( prev_jcr ) ; } return jcr ; }
Get next jcr from chain, and release current one
Get next jcr from chain and release current one