Replace delay by deadline in timedwait()

The function sc_cond_timedwait() accepted a parameter representing the
max duration to wait, because it internally uses SDL_CondWaitTimeout().

Instead, accept a deadline, to be consistent with
pthread_cond_timedwait().
This commit is contained in:
Romain Vimont
2021-07-04 17:04:20 +02:00
parent ec871dd3f5
commit 32e692d5d2
4 changed files with 8 additions and 9 deletions

View File

@@ -557,7 +557,7 @@ server_stop(struct server *server) {
#define WATCHDOG_DELAY SC_TICK_FROM_SEC(1)
signaled = sc_cond_timedwait(&server->process_terminated_cond,
&server->mutex,
WATCHDOG_DELAY);
sc_tick_now() + WATCHDOG_DELAY);
}
sc_mutex_unlock(&server->mutex);