From 7a3ae91781b10cb335ff6c33e26d0722e09581fe Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Thu, 15 Feb 2018 13:54:55 +0000 Subject: [PATCH] Call pthread_rwlock_init on the rwlock The spec says the results are undefined if an uninitialised read-write lock is used without being initialised, though evidently things were working out alright --- daemon/gamemode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/gamemode.c b/daemon/gamemode.c index 1ef32b8..d77100f 100644 --- a/daemon/gamemode.c +++ b/daemon/gamemode.c @@ -102,6 +102,7 @@ void game_mode_context_init(GameModeContext *self) update_initial_gov_state(); LOG_MSG("governor is set to [%s]\n", get_initial_governor()); + pthread_rwlock_init(&self->rwlock, NULL); pthread_mutex_init(&self->reaper.mutex, NULL); pthread_cond_init(&self->reaper.condition, NULL);