FACT++  1.0
void signalCEready ( int  ceState)

Definition at line 777 of file feeserver.c.

777  {
778  int status = -1;
779 
780  // set cancel type to deferred
781  status = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, 0);
782 # ifdef __DEBUG
783  if (status != 0) {
784  printf("Set cancel type error: %d\n", status);
785  fflush(stdout);
786  }
787 # endif
788 
789  //lock the mutex before broadcast
790  status = pthread_mutex_lock(&wait_init_mut);
791 # ifdef __DEBUG
792  if (status != 0) {
793  printf("Lock mutex error: %d\n", status);
794  fflush(stdout);
795  }
796 # endif
797 
798  // provide init state of CE
799  ceInitState = ceState;
800 
801  //signal that CE has completed initialisation
802  // maybe try the call pthread_cond_signal instead for performance
803  pthread_cond_broadcast(&init_cond);
804 
805  // set variable for backup solution
806  ceReadySignaled = true;
807 
808  // unlock mutex
809  status = pthread_mutex_unlock(&wait_init_mut);
810 # ifdef __DEBUG
811  if (status != 0) {
812  printf("Unlock mutex error: %d\n", status);
813  fflush(stdout);
814  }
815 # endif
816 
817  // set cancel type to asyncroneous
818  status = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
819 # ifdef __DEBUG
820  if (status != 0) {
821  printf("Set cancel type error: %d\n", status);
822  fflush(stdout);
823  }
824 # endif
825 }
static bool ceReadySignaled
Definition: feeserver.c:77
static int ceInitState
Definition: feeserver.c:83
static pthread_cond_t init_cond
Definition: feeserver.c:248
static pthread_mutex_t wait_init_mut
Definition: feeserver.c:260