Wrap tick API

This avoids to use the SDL timer API directly, and will allow to handle
generic ticks (possibly negative).
This commit is contained in:
Romain Vimont
2021-07-04 16:50:19 +02:00
parent 5524f378c8
commit ec871dd3f5
8 changed files with 58 additions and 16 deletions

View File

@@ -554,10 +554,10 @@ server_stop(struct server *server) {
sc_mutex_lock(&server->mutex);
bool signaled = false;
if (!server->process_terminated) {
#define WATCHDOG_DELAY_MS 1000
#define WATCHDOG_DELAY SC_TICK_FROM_SEC(1)
signaled = sc_cond_timedwait(&server->process_terminated_cond,
&server->mutex,
WATCHDOG_DELAY_MS);
WATCHDOG_DELAY);
}
sc_mutex_unlock(&server->mutex);