src/dird/msgchan.c
bool start_storage_daemon_message_thread(JCR *jcr)
{
   int status;
   pthread_t thid;

   jcr->inc_use_count();              /* mark in use by msg thread */
   jcr->sd_msg_thread_done = false;
   jcr->SD_msg_chan_started = false;
   Dmsg0(150, "Start SD msg_thread.\n");
   if ((status=pthread_create(&thid, NULL, msg_thread, (void *)jcr)) != 0) {
      berrno be;
      Jmsg1(jcr, M_ABORT, 0, _("Cannot create message thread: %s\n"), be.bstrerror(status));
   }
   /* Wait for thread to start */
   while (jcr->SD_msg_chan_started == false) {
      bmicrosleep(0, 50);
      if (job_canceled(jcr) || jcr->sd_msg_thread_done) {
         return false;
      }
   }
   Dmsg1(150, "SD msg_thread started. use=%d\n", jcr->use_count());
   return true;
}
/*
 * Start a thread to handle Storage daemon messages and
 *  Catalog requests.
 */
Start a thread to handle Storage daemon messages and
Catalog requests.
Start a thread to handle Storage daemon messages and Catalog requests .
bool start_storage_daemon_message_thread(JCR *jcr)
{
   int status;
   pthread_t thid;
   jcr->inc_use_count();              
   jcr->sd_msg_thread_done = false;
   jcr->SD_msg_chan_started = false;
   Dmsg0(150, "Start SD msg_thread.\n");
   if ((status=pthread_create(&thid, NULL, msg_thread, (void *)jcr)) != 0) {
      berrno be;
      Jmsg1(jcr, M_ABORT, 0, _("Cannot create message thread: %s\n"), be.bstrerror(status));
   }
   while (jcr->SD_msg_chan_started == false) {
      bmicrosleep(0, 50);
      if (job_canceled(jcr) || jcr->sd_msg_thread_done) {
         return false;
      }
   }
   Dmsg1(150, "SD msg_thread started. use=%d\n", jcr->use_count());
   return true;
}
bool start_storage_daemon_message_thread ( JCR * jcr ) { int status ; pthread_t thid ; jcr -> inc_use_count ( ) ; jcr -> sd_msg_thread_done = false ; jcr -> SD_msg_chan_started = false ; Dmsg0 ( 150 , " \n " ) ; if ( ( status = pthread_create ( & thid , NULL , msg_thread , ( void * ) jcr ) ) != 0 ) { berrno be ; Jmsg1 ( jcr , M_ABORT , 0 , _ ( " \n " ) , be . bstrerror ( status ) ) ; } while ( jcr -> SD_msg_chan_started == false ) { bmicrosleep ( 0 , 50 ) ; if ( job_canceled ( jcr ) || jcr -> sd_msg_thread_done ) { return false ; } } Dmsg1 ( 150 , " \n " , jcr -> use_count ( ) ) ; return true ; }
Start a thread to handle Storage daemon messages and
  Catalog requests.
Start a thread to handle Storage daemon messages and Catalog requests .
/* mark in use by msg thread */ /* Wait for thread to start */