pthread_cond_init(&loop_cond, NULL); /* TODO : error handling if return value is not 0, fail logic */
pthread_mutex_lock(&loop_mutex);
- pthread_create(&main_loop_thread_id, 0, _main_loop_rutine, 0);
+ int status_thread_create = 0;
+ status_thread_create = pthread_create(&main_loop_thread_id, 0, _main_loop_rutine, 0);
+ if(status_thread_create != 0) {
+ _DEBUG_WARNING("pthread_create [%d]", status_thread_create );
+ pthread_mutex_unlock(&loop_mutex);
+ _EXTERN_FUNC_EXIT;
+ return;
+ }
do {
pthread_cond_wait(&loop_cond, &loop_mutex);
} while (loop == NULL);