From 615889948b1b8103f4598a3b32566a8623dcff05 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 3 Jul 2023 17:26:18 +0200 Subject: [PATCH] Extern playlists/maplist vec mutex Reduces initialization overhead. --- r5dev/vpc/keyvalues.cpp | 6 +++++- r5dev/vpc/keyvalues.h | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/r5dev/vpc/keyvalues.cpp b/r5dev/vpc/keyvalues.cpp index 6bcec04e..3f97723a 100644 --- a/r5dev/vpc/keyvalues.cpp +++ b/r5dev/vpc/keyvalues.cpp @@ -1367,5 +1367,9 @@ void VKeyValues::Detach() const /////////////////////////////////////////////////////////////////////////////// inline KeyValues** g_pPlaylistKeyValues = nullptr; // Get the KeyValue for the playlist file. + vector g_vAllPlaylists = { "<>" }; -vector g_vGameInfoPaths = { "/" }; \ No newline at end of file +vector g_vGameInfoPaths = { "/" }; + +std::mutex g_InstalledMapsMutex; +std::mutex g_PlaylistsVecMutex; diff --git a/r5dev/vpc/keyvalues.h b/r5dev/vpc/keyvalues.h index 9c566f0f..a86001e2 100644 --- a/r5dev/vpc/keyvalues.h +++ b/r5dev/vpc/keyvalues.h @@ -9,8 +9,8 @@ extern vector g_vAllPlaylists; extern vector g_vGameInfoPaths; -inline std::mutex g_InstalledMapsMutex; -inline std::mutex g_PlaylistsVecMutex; +extern std::mutex g_InstalledMapsMutex; +extern std::mutex g_PlaylistsVecMutex; //--------------------------------------------------------------------------------- // Purpose: Forward declarations