aboutsummaryrefslogtreecommitdiff
path: root/src/zencore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-03-24 18:50:59 +0100
committerGitHub Enterprise <[email protected]>2026-03-24 18:50:59 +0100
commitb730eebe53d1d6827d4b6c320ccfd80566a629a6 (patch)
treed8df23d781b5fb3b1d7bd170fa7d81e2501ab901 /src/zencore
parentSubprocess Manager (#889) (diff)
downloadzen-b730eebe53d1d6827d4b6c320ccfd80566a629a6.tar.xz
zen-b730eebe53d1d6827d4b6c320ccfd80566a629a6.zip
hub async provision/deprovision/hibernate/wake (#891)
- Improvement: Hub provision, deprovision, hibernate, and wake operations are now async. HTTP requests returns 202 Accepted while the operation completes in the background - Improvement: Hub returns 202 Accepted (instead of 409 Conflict) when the same async operation is already in progress for a module - Improvement: Hub returns 200 OK when a requested state transition is already satisfied
Diffstat (limited to 'src/zencore')
-rw-r--r--src/zencore/include/zencore/thread.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/thread.h b/src/zencore/include/zencore/thread.h
index d7262324f..56ce5904b 100644
--- a/src/zencore/include/zencore/thread.h
+++ b/src/zencore/include/zencore/thread.h
@@ -190,6 +190,13 @@ class Latch
public:
Latch(std::ptrdiff_t Count) : Counter(Count) {}
+ void Reset(std::ptrdiff_t Count)
+ {
+ ZEN_ASSERT(Counter.load() == 0);
+ Complete.Reset();
+ Counter.store(Count);
+ }
+
void CountDown()
{
std::ptrdiff_t Old = Counter.fetch_sub(1);