rem: struct timeval now; gettimeofday(&now, 0); struct timespec sleepcount; sleepcount.tv_sec = now.tv_sec + timeout; sleepcount.tv_nsec = now.tv_usec * 1000;  pthread_mutex_lock(&impl_repp->ecasound_stop_mutex_repp); int ret = pthread_cond_timedwait(&impl_repp->ecasound_stop_cond_repp, &impl_repp->ecasound_stop_mutex_repp, &sleepcount); pthread_mutex_unlock(&impl_repp->ecasound_stop_mutex_repp);  if (ret == 0) ecadebug->msg(ECA_DEBUG::system_objects, "(eca-engine) Stop signal ok"); else if (ret == -ETIMEDOUT) ecadebug->msg(ECA_DEBUG::info, "(eca-engine) Stop signal failed; timeout"); else ecadebug->msg(ECA_DEBUG::info, "(eca-engine) Stop signal failed");
add: int ret = kvu_pthread_timed_wait(&impl_repp->ecasound_stop_mutex_repp, &impl_repp->ecasound_stop_cond_repp, timeout); ECA_LOG_MSG(ECA_LOGGER::info, kvu_pthread_timed_wait_result(ret, "(eca_main) wait_for_stop"));
context: void ECA_ENGINE::wait_for_stop(int timeout){  struct timeval now;  gettimeofday(&now, 0);  struct timespec sleepcount;  sleepcount.tv_sec = now.tv_sec + timeout;  sleepcount.tv_nsec = now.tv_usec * 1000;  pthread_mutex_lock(&impl_repp->ecasound_stop_mutex_repp);  int ret = pthread_cond_timedwait(&impl_repp->ecasound_stop_cond_repp, 				   &impl_repp->ecasound_stop_mutex_repp, 				    &sleepcount);  pthread_mutex_unlock(&impl_repp->ecasound_stop_mutex_repp);  if (ret == 0)    ecadebug->msg(ECA_DEBUG::system_objects, "(eca-engine) Stop signal ok");  else if (ret == -ETIMEDOUT)    ecadebug->msg(ECA_DEBUG::info, "(eca-engine) Stop signal failed; timeout");  else    ecadebug->msg(ECA_DEBUG::info, "(eca-engine) Stop signal failed");}