diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-05-17 14:32:11 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-05-17 16:18:08 +0100 |
| commit | 7b1aeee4565fe0a2eed4a4fa8695b2a5fb671e06 (patch) | |
| tree | 1ea4e2565a8f8f57e85d27291810cad07cd3b6be /src/ingestor.hpp | |
| parent | 29f458117184af5b1507cac01b48b41bfbad568a (diff) | |
| download | webstat-7b1aeee4565fe0a2eed4a4fa8695b2a5fb671e06.tar.bz2 webstat-7b1aeee4565fe0a2eed4a4fa8695b2a5fb671e06.tar.xz webstat-7b1aeee4565fe0a2eed4a4fa8695b2a5fb671e06.zip | |
Add ThreadSafeT helper
Wraps a templated value and a templated mutex (defaults to shared_mutex)
and provides safe access, locked with either a shared_lock (const value)
or lock_guard (non-const value).
Applies this to existingEntities.
Diffstat (limited to 'src/ingestor.hpp')
| -rw-r--r-- | src/ingestor.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ingestor.hpp b/src/ingestor.hpp index 738357b..c2a47a4 100644 --- a/src/ingestor.hpp +++ b/src/ingestor.hpp @@ -99,7 +99,7 @@ namespace WebStat { DB::ConnectionPoolPtr dbpool; mutable Stats stats {}; - std::map<EntityHash, EntityId> existingEntities; + ThreadSafeT<std::map<EntityHash, EntityId>> existingEntities; LineBatch queuedLines, processingLines; bool terminated = false; |
