diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-12-20 14:33:43 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-12-20 14:33:43 -0500 |
commit | 3c49081df34fb1801063c0b538d12d4422fcf3f0 (patch) | |
tree | f4d267d953c97b0ee3e78730d8e36484abf7f096 /src/ap_state.h | |
parent | 5a7559e39d2cd8306a99adbc6d39e90716b14687 (diff) | |
download | lingo-ap-tracker-3c49081df34fb1801063c0b538d12d4422fcf3f0.tar.gz lingo-ap-tracker-3c49081df34fb1801063c0b538d12d4422fcf3f0.tar.bz2 lingo-ap-tracker-3c49081df34fb1801063c0b538d12d4422fcf3f0.zip |
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.
Diffstat (limited to 'src/ap_state.h')
-rw-r--r-- | src/ap_state.h | 9 |
1 files changed, 3 insertions, 6 deletions
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(); | |||
68 | 68 | ||
69 | bool AP_IsPaintingShuffle(); | 69 | bool AP_IsPaintingShuffle(); |
70 | 70 | ||
71 | // WARNING: Not thread-safe! | 71 | std::map<std::string, std::string> AP_GetPaintingMapping(); |
72 | const std::map<std::string, std::string>& AP_GetPaintingMapping(); | ||
73 | 72 | ||
74 | bool AP_IsPaintingMappedTo(const std::string& painting_id); | 73 | bool AP_IsPaintingMappedTo(const std::string& painting_id); |
75 | 74 | ||
76 | // WARNING: Not thread-safe! | 75 | std::set<std::string> AP_GetCheckedPaintings(); |
77 | const std::set<std::string>& AP_GetCheckedPaintings(); | ||
78 | 76 | ||
79 | bool AP_IsPaintingChecked(const std::string& painting_id); | 77 | bool AP_IsPaintingChecked(const std::string& painting_id); |
80 | 78 | ||
@@ -100,8 +98,7 @@ SunwarpAccess AP_GetSunwarpAccess(); | |||
100 | 98 | ||
101 | bool AP_IsSunwarpShuffle(); | 99 | bool AP_IsSunwarpShuffle(); |
102 | 100 | ||
103 | // WARNING: Not thread-safe! | 101 | std::map<int, SunwarpMapping> AP_GetSunwarpMapping(); |
104 | const std::map<int, SunwarpMapping>& AP_GetSunwarpMapping(); | ||
105 | 102 | ||
106 | bool AP_HasReachedGoal(); | 103 | bool AP_HasReachedGoal(); |
107 | 104 | ||