Lines Matching defs:thelper

41    thelper - thelper instance
53 int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper)
56 thelper->thread_exit = 0;
57 thelper->thread_ready = 0;
58 result = pthread_cond_init( &thelper->thread_cond, NULL);
63 result = pthread_mutex_init(&thelper->thread_mutex, NULL);
65 pthread_cond_destroy(&thelper->thread_cond);
76 thelper - pointer to thelper instance
88 int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper)
91 result = pthread_cond_destroy( &thelper->thread_cond);
96 result = pthread_mutex_destroy(&thelper->thread_mutex);
111 thelper - pointer to thelper instance
123 int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper)
127 pthread_mutex_lock(&thelper->thread_mutex);
128 if (!thelper->thread_ready && !thelper->thread_exit) {
129 result = pthread_cond_wait(&thelper->thread_cond, &thelper->thread_mutex);
132 if (thelper->thread_exit) {
135 pthread_mutex_unlock(&thelper->thread_mutex);
146 thelper - pointer to thelper instance
158 int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper)
162 LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
164 pthread_mutex_lock(&thelper->thread_mutex);
165 thelper->thread_ready = 1;
166 result = pthread_cond_signal(&thelper->thread_cond);
167 pthread_mutex_unlock(&thelper->thread_mutex);
178 thelper - pointer to thelper instance
190 int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper)
192 int result = thelper->thread_ready;
194 LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
196 pthread_mutex_lock(&thelper->thread_mutex);
197 thelper->thread_ready = 0;
198 pthread_mutex_unlock(&thelper->thread_mutex);
224 struct loc_eng_dmn_conn_thelper * thelper = (struct loc_eng_dmn_conn_thelper *) data;
226 if (thelper->thread_proc_init) {
227 result = thelper->thread_proc_init(thelper->thread_context);
229 thelper->thread_exit = 1;
230 thelper_signal_ready(thelper);
231 LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
236 thelper_signal_ready(thelper);
238 if (thelper->thread_proc_pre) {
239 result = thelper->thread_proc_pre(thelper->thread_context);
241 thelper->thread_exit = 1;
242 LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
248 if (thelper->thread_proc) {
249 result = thelper->thread_proc(thelper->thread_context);
251 thelper->thread_exit = 1;
252 LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
255 } while (thelper->thread_exit == 0);
257 if (thelper->thread_proc_post) {
258 result = thelper->thread_proc_post(thelper->thread_context);
262 LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
280 thelper - pointer to thelper instance
297 int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper,
307 thelper_signal_init(thelper);
310 thelper->thread_context = context;
313 thelper->thread_proc_init = thread_proc_init;
314 thelper->thread_proc_pre = thread_proc_pre;
315 thelper->thread_proc = thread_proc;
316 thelper->thread_proc_post = thread_proc_post;
318 LOC_LOGD("%s:%d] 0x%lx call pthread_create\n", __func__, __LINE__, (long) thelper);
321 thelper->thread_id = create_thread_cb("loc_eng_dmn_conn",
322 thelper_main_2, (void *)thelper);
324 result = pthread_create(&thelper->thread_id, NULL,
325 thelper_main, (void *)thelper);
329 LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
333 LOC_LOGD("%s:%d] 0x%lx pthread_create done\n", __func__, __LINE__, (long) thelper);
335 thelper_signal_wait(thelper);
337 LOC_LOGD("%s:%d] 0x%lx pthread ready\n", __func__, __LINE__, (long) thelper);
338 return thelper->thread_exit;
347 thelper - pointer to thelper instance
359 int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper)
361 LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
362 thelper->thread_exit = 1;
369 thelper - pointer to thelper instance
384 int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper)
388 LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
389 result = pthread_join(thelper->thread_id, NULL);
391 LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
393 LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
395 thelper_signal_destroy(thelper);