FACT++  1.0
void dim_init ( )

Definition at line 109 of file dim_thr_old.c.

References dim_dtq_thread(), DIM_INIT_Sema, dim_tcpip_thread(), DIM_THR_init_done, dna_init(), ignore_sigpipe(), INIT_count, INIT_thread, and MAIN_thread.

Referenced by dim_init_threads(), and dim_signal_cond().

110 {
111  pthread_t t_id;
112  void ignore_sigpipe();
113  int ret;
114  extern int dna_init();
115 /*
116 #ifdef LYNXOS
117 */
118  pthread_attr_t attr;
119 /*
120 #endif
121 */
122  if(!DIM_THR_init_done)
123  {
124  /*
125  int prio;
126  */
127  DIM_THR_init_done = 1;
128  dna_init();
129  /*
130  thr_getprio(thr_self(),&prio);
131  thr_setprio(thr_self(),prio+3);
132  */
133  INIT_thread = pthread_self();
135 
136 #ifndef darwin
137  sem_init(&DIM_INIT_Sema, 0, INIT_count);
138  /*
139  sem_init(&DIM_WAIT_Sema, 0, WAIT_count);
140  */
141 #else
142  DIM_INIT_Semap = sem_open("/Dim_INIT_Sem", O_CREAT, S_IRUSR | S_IWUSR, INIT_count);
143  /*
144  DIM_WAIT_Semap = sem_open("/Dim_WAIT_Sem", O_CREAT, S_IRUSR | S_IWUSR, WAIT_count);
145  */
146 #endif
147 
148  ignore_sigpipe();
149 
150 #if defined (LYNXOS) && !defined (__Lynx__)
151  pthread_attr_create(&attr);
152  pthread_create(&t_id, attr, dim_dtq_thread, 0);
153 #else
154 /*
155  pthread_create(&t_id, NULL, dim_dtq_thread, 0);
156 */
157  pthread_attr_init(&attr);
158  pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
159  pthread_create(&t_id, &attr, dim_dtq_thread, 0);
160 #endif
161 #ifndef darwin
162  ret = sem_wait(&DIM_INIT_Sema);
163 #else
164  ret = sem_wait(DIM_INIT_Semap);
165 #endif
166 #if defined (LYNXOS) && !defined (__Lynx__)
167  pthread_create(&t_id, attr, dim_tcpip_thread, 0);
168 #else
169  pthread_create(&t_id, &attr, dim_tcpip_thread, 0);
170 #endif
171 #ifndef darwin
172  ret = sem_wait(&DIM_INIT_Sema);
173 #else
174  ret = sem_wait(DIM_INIT_Semap);
175 #endif
176  INIT_thread = 0;
177  }
178 }
pthread_t MAIN_thread
Definition: dim_thr_old.c:21
int INIT_count
Definition: dim_thr_old.c:33
void ignore_sigpipe()
Definition: dim_thr_old.c:348
pthread_t INIT_thread
Definition: dim_thr_old.c:20
int DIM_THR_init_done
Definition: dim_thr_old.c:37
void * dim_dtq_thread(void *tag)
Definition: dim_thr_old.c:73
int dna_init()
Definition: dna.c:530
sem_t DIM_INIT_Sema
Definition: dim_thr_old.c:23
void * dim_tcpip_thread(void *tag)
Definition: dim_thr_old.c:39

+ Here is the call graph for this function:

+ Here is the caller graph for this function: