FACT++  1.0
int startLogWatchDogThread ( )

Definition at line 2079 of file feeserver.c.

References runLogWatchDog().

Referenced by start().

2079  {
2080  int status = -1;
2081  pthread_attr_t attr;
2082 
2083  // init thread attribut and set it
2084  status = pthread_attr_init(&attr);
2085  if (status != 0) {
2086 # ifdef __DEBUG
2087  printf("Init attribute error [LogWatchDog]: %d\n", status);
2088  fflush(stdout);
2089 # endif
2090  return FEE_THREAD_ERROR;
2091  }
2092  status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
2093  if (status != 0) {
2094 # ifdef __DEBUG
2095  printf("Set attribute error [LogWatchDog]: %d\n", status);
2096  fflush(stdout);
2097 # endif
2098  return FEE_THREAD_ERROR;
2099  }
2100 
2101  // start the LogWatchDog thread
2102  status = pthread_create(&thread_logWatchdog, &attr, (void*) &runLogWatchDog,
2103  0);
2104  if (status != 0) {
2105 # ifdef __DEBUG
2106  printf("Create thread error [LogWatchDog]: %d\n", status);
2107  fflush(stdout);
2108 # endif
2109  return FEE_THREAD_ERROR;
2110  }
2111 
2112  // cleanup attribut
2113  status = pthread_attr_destroy(&attr);
2114  if (status != 0) {
2115 # ifdef __DEBUG
2116  printf("Destroy attribute error [LogWatchDog]: %d\n", status);
2117  fflush(stdout);
2118 # endif
2119  // no error return value necessary !
2120  }
2121 
2122  return FEE_OK;
2123 }
void runLogWatchDog()
Definition: feeserver.c:2125
static pthread_t thread_logWatchdog
Definition: feeserver.c:236

+ Here is the call graph for this function:

+ Here is the caller graph for this function: