Skip to content

Commit

Permalink
Adjust timeout value of pthread_cond_timedwait() for waiting housekee…
Browse files Browse the repository at this point in the history
…per initialization
  • Loading branch information
koeikim committed Oct 16, 2024
1 parent beb8958 commit bed3109
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/dlt_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bed3109

Please sign in to comment.