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/ap_state.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/ap_state.h') diff --git a/src/ap_state.h b/src/ap_state.h index a23b13d..2da0b8e 100644 --- a/src/ap_state.h +++ b/src/ap_state.h @@ -68,13 +68,11 @@ bool AP_IsColorShuffle(); bool AP_IsPaintingShuffle(); -// WARNING: Not thread-safe! -const std::map& AP_GetPaintingMapping(); +std::map AP_GetPaintingMapping(); bool AP_IsPaintingMappedTo(const std::string& painting_id); -// WARNING: Not thread-safe! -const std::set& AP_GetCheckedPaintings(); +std::set AP_GetCheckedPaintings(); bool AP_IsPaintingChecked(const std::string& painting_id); @@ -100,8 +98,7 @@ SunwarpAccess AP_GetSunwarpAccess(); bool AP_IsSunwarpShuffle(); -// WARNING: Not thread-safe! -const std::map& AP_GetSunwarpMapping(); +std::map AP_GetSunwarpMapping(); bool AP_HasReachedGoal(); -- cgit 1.4.1