Jelajahi Sumber

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
Marc Di Luzio 7 tahun lalu
induk
melakukan
7a3ae91781
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      daemon/gamemode.c

+ 1 - 0
daemon/gamemode.c

@@ -102,6 +102,7 @@ void game_mode_context_init(GameModeContext *self)
 	update_initial_gov_state();
 	update_initial_gov_state();
 	LOG_MSG("governor is set to [%s]\n", get_initial_governor());
 	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_mutex_init(&self->reaper.mutex, NULL);
 	pthread_cond_init(&self->reaper.condition, NULL);
 	pthread_cond_init(&self->reaper.condition, NULL);