diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index 4ade95bf..7c1131c5 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -5230,8 +5230,13 @@ int dlt_start_threads() * even if we missed the signal */ clock_gettime(CLOCK_MONOTONIC, &now); - single_wait.tv_sec = now.tv_sec; - single_wait.tv_nsec = now.tv_nsec + 500000000; + if (now.tv_nsec >= 500000000) { + single_wait.tv_sec = now.tv_sec + 1; + single_wait.tv_nsec = now.tv_nsec - 500000000; + } else { + single_wait.tv_sec = now.tv_sec; + single_wait.tv_nsec = now.tv_nsec + 500000000; + } // pthread_cond_timedwait has to be called on a locked mutex pthread_mutex_lock(&dlt_housekeeper_running_mutex);