Lines Matching refs:t

58     timer_data* t = (timer_data*)thread_data;  in timer_thread()  local
60 LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec); in timer_thread()
64 if(t->time_msec >= 1000) { in timer_thread()
65 ts.tv_sec += t->time_msec/1000; in timer_thread()
66 t->time_msec = t->time_msec % 1000; in timer_thread()
68 if(t->time_msec) in timer_thread()
69 ts.tv_nsec += t->time_msec * 1000000; in timer_thread()
80 pthread_mutex_lock(&(t->timer_mutex)); in timer_thread()
81 if (READY == t->state) { in timer_thread()
82 t->state = WAITING; in timer_thread()
83 ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts); in timer_thread()
84 t->state = DONE; in timer_thread()
86 pthread_mutex_unlock(&(t->timer_mutex)); in timer_thread()
104 pthread_mutex_destroy(&t->timer_mutex); in timer_thread()
105 pthread_cond_destroy(&t->timer_cond); in timer_thread()
108 t->callback_func(t->user_data, ret); in timer_thread()
110 free(t); in timer_thread()
118 timer_data *t=NULL; in loc_timer_start() local
126 t = (timer_data *)calloc(1, sizeof(timer_data)); in loc_timer_start()
127 if(t == NULL) { in loc_timer_start()
133 if(pthread_cond_init(&(t->timer_cond), NULL)) { in loc_timer_start()
137 if(pthread_mutex_init(&(t->timer_mutex), NULL)) { in loc_timer_start()
142 t->callback_func = cb_func; in loc_timer_start()
143 t->user_data = caller_data; in loc_timer_start()
144 t->time_msec = msec; in loc_timer_start()
145 t->state = READY; in loc_timer_start()
153 if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) { in loc_timer_start()
165 pthread_mutex_destroy(&t->timer_mutex); in loc_timer_start()
167 pthread_cond_destroy(&t->timer_cond); in loc_timer_start()
169 free(t); in loc_timer_start()
172 return t; in loc_timer_start()
176 timer_data* t = (timer_data*)handle; in loc_timer_stop() local
178 if (NULL != t && (READY == t->state || WAITING == t->state)) { in loc_timer_stop()
179 pthread_mutex_lock(&(t->timer_mutex)); in loc_timer_stop()
180 if (READY == t->state || WAITING == t->state) { in loc_timer_stop()
181 pthread_cond_signal(&t->timer_cond); in loc_timer_stop()
182 t->state = ABORT; in loc_timer_stop()
184 pthread_mutex_unlock(&(t->timer_mutex)); in loc_timer_stop()