From 3c49081df34fb1801063c0b538d12d4422fcf3f0 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 20 Dec 2024 14:33:43 -0500 Subject: Fixed remaining thread unsafe APState/IPCState reads Still would like to add some kind of wrapper object that TrackerState could use to read APState without locking, since it'll only ever be called from the thread that would do the mutating, but this is fine for now. --- src/ipc_state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ipc_state.cpp') diff --git a/src/ipc_state.cpp b/src/ipc_state.cpp index cba576c..1f8d286 100644 --- a/src/ipc_state.cpp +++ b/src/ipc_state.cpp @@ -103,7 +103,7 @@ struct IPCState { return player_position; } - const std::set& GetSolvedPanels() { + std::set GetSolvedPanels() { std::lock_guard state_guard(state_mutex); return solved_panels; @@ -383,6 +383,6 @@ std::optional> IPC_GetPlayerPosition() { return GetState().GetPlayerPosition(); } -const std::set& IPC_GetSolvedPanels() { +std::set IPC_GetSolvedPanels() { return GetState().GetSolvedPanels(); } -- cgit 1.4.1