- pthread_mutex_lock(&thread_state.lock);
- while (!thread_state.is_running) {
- pthread_cond_wait(&thread_state.cond,
- &thread_state.lock);
+ DBG("Waiting for client thread to be ready");
+ sem_wait(&thread_state.ready);
+ if (thread_state.running) {
+ DBG("Client thread is ready");
+ } else {
+ ERR("Initialization of client thread failed");