Refactor getting config values to stop duplicating the rwlock

This commit is contained in:
Marc Di Luzio
2018-05-15 16:52:06 +01:00
parent 39ad076fa9
commit 79f620e013
4 changed files with 58 additions and 26 deletions

View File

@@ -460,7 +460,8 @@ static void *game_mode_context_reaper(void *userdata)
/* Stack, not allocated, won't disappear. */
GameModeContext *self = userdata;
long reaper_interval = config_get_reaper_thread_frequency(self->config);
long reaper_interval = 0.0f;
config_get_reaper_thread_frequency(self->config, &reaper_interval);
struct timespec ts = { 0, 0 };
ts.tv_sec = time(NULL) + reaper_interval;