aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/httpstructuredcache.h
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-12-19 12:06:13 +0100
committerGitHub <[email protected]>2023-12-19 12:06:13 +0100
commit519d942d809e740a3b1fe5a1f6a57a4cfe43408b (patch)
tree9b3c084e21bb7fd5e6bb3335e890647062d0703b /src/zenserver/cache/httpstructuredcache.h
parentadded mimalloc_hooks (diff)
parentensure we can build without trace (#619) (diff)
downloadzen-273-integrated-memory-tracking.tar.xz
zen-273-integrated-memory-tracking.zip
Merge branch 'main' into 273-integrated-memory-tracking273-integrated-memory-tracking
Diffstat (limited to 'src/zenserver/cache/httpstructuredcache.h')
-rw-r--r--src/zenserver/cache/httpstructuredcache.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/zenserver/cache/httpstructuredcache.h b/src/zenserver/cache/httpstructuredcache.h
index 57a533029..2feaaead8 100644
--- a/src/zenserver/cache/httpstructuredcache.h
+++ b/src/zenserver/cache/httpstructuredcache.h
@@ -190,6 +190,12 @@ private:
void ReplayRequestRecorder(const CacheRequestContext& Context, cache::IRpcRequestReplayer& Replayer, uint32_t ThreadCount);
+ // This exists to avoid taking locks when recording is not enabled
+ std::atomic_bool m_RequestRecordingEnabled{false};
+
+ // This lock should be taken in SHARED mode when calling into the recorder,
+ // and taken in EXCLUSIVE mode whenever the recorder is created or destroyed
+ RwLock m_RequestRecordingLock;
std::unique_ptr<cache::IRpcRequestRecorder> m_RequestRecorder;
};