rem: int ret = kvu_pthread_timed_wait(&impl_repp->ecasound_stop_mutex_repp, &impl_repp->ecasound_stop_cond_repp, timeout); ecadebug->msg(ECA_DEBUG::info, kvu_pthread_timed_wait_result(ret, "(eca_main) wait_for_stop"));
add: pthread_mutex_lock(ecasound_stop_mutex_repp); int ret = pthread_cond_timedwait(ecasound_stop_cond_repp, ecasound_stop_mutex_repp, &sleepcount); pthread_mutex_unlock(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");
context: void ECA_ENGINE::wait_for_stop(int timeout){  int ret = kvu_pthread_timed_wait(&impl_repp->ecasound_stop_mutex_repp, 				   &impl_repp->ecasound_stop_cond_repp, 				   timeout);  ecadebug->msg(ECA_DEBUG::info, 		kvu_pthread_timed_wait_result(ret, "(eca_main) wait_for_stop"));}