aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-12-07 10:55:57 +0100
committerGitHub <[email protected]>2022-12-07 01:55:57 -0800
commit10c141fece26f9946595028afb069cbee1502067 (patch)
tree1513b9e704db223803f8181400946e70fd7a9241 /zencore/include
parentUse Iso8601 format for logging start and end message (#202) (diff)
downloadzen-10c141fece26f9946595028afb069cbee1502067.tar.xz
zen-10c141fece26f9946595028afb069cbee1502067.zip
Cache request record/replay (#198)
This adds recording and playback of cache request with full data - both get and put operations can be replayed. Invoke via web request. `<host>/z$/exec$/start-recording?<disk-storage-path>` `<host>/z$/exec$/stop-recording` `<host>/z$/exec$/replay-recording?<thread-count>&<disk-storage-path>`
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/thread.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/zencore/include/zencore/thread.h b/zencore/include/zencore/thread.h
index 3c1821a62..2aad22061 100644
--- a/zencore/include/zencore/thread.h
+++ b/zencore/include/zencore/thread.h
@@ -161,13 +161,16 @@ public:
}
}
- void Wait()
+ std::ptrdiff_t Remaining() const { return Counter.load(); }
+
+ bool Wait(int TimeoutMs = -1)
{
std::ptrdiff_t Old = Counter.load();
- if (Old != 0)
+ if (Old == 0)
{
- Complete.Wait();
+ return true;
}
+ return Complete.Wait(TimeoutMs);
}
private: