FACT++  1.0
void dim_stop ( )

Definition at line 180 of file dim_thr_old.c.

References ALRM_thread, Curr_N_Conns, dim_dtq_stop(), DIM_INIT_Sema, dim_tcpip_stop(), DIM_THR_init_done, i, IO_thread, and Net_conns.

Referenced by dim_signal_cond(), and dim_stop_threads().

181 {
182  int i;
183  int n = 0;
184  void dim_tcpip_stop(), dim_dtq_stop();
185 
186  for( i = 0; i< Curr_N_Conns; i++ )
187  {
188  if(Net_conns[i].channel != 0)
189  n++;
190  }
191  if(n)
192  return;
193  if(IO_thread)
194  pthread_cancel(IO_thread);
195  if(ALRM_thread)
196  pthread_cancel(ALRM_thread);
197 #ifndef darwin
198  sem_destroy(&DIM_INIT_Sema);
199  /*
200  sem_destroy(&DIM_WAIT_Sema);
201  */
202 #else
203  sem_unlink("/Dim_INIT_Sem");
204  /*
205  sem_unlink("/Dim_WAIT_Sem");
206  */
207  sem_close(DIM_INIT_Semap);
208  /*
209  sem_close(DIM_WAIT_Semap);
210  */
211 #endif
212  dim_tcpip_stop();
213  dim_dtq_stop();
214  if(IO_thread)
215  pthread_join(IO_thread,0);
216  if(ALRM_thread)
217  pthread_join(ALRM_thread,0);
218  IO_thread = 0;
219  ALRM_thread = 0;
220  DIM_THR_init_done = 0;
221 }
DllExp DIM_NOSHARE int Curr_N_Conns
Definition: conn_handler.c:33
void dim_tcpip_stop()
Definition: tcpip.c:341
int i
Definition: db_dim_client.c:21
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
pthread_t IO_thread
Definition: dim_thr_old.c:18
void dim_dtq_stop()
Definition: dtq.c:200
int DIM_THR_init_done
Definition: dim_thr_old.c:37
pthread_t ALRM_thread
Definition: dim_thr_old.c:19
sem_t DIM_INIT_Sema
Definition: dim_thr_old.c:23

+ Here is the call graph for this function:

+ Here is the caller graph for this function: