aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/thread.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2026-03-20 13:44:00 +0100
committerGitHub Enterprise <[email protected]>2026-03-20 13:44:00 +0100
commit7cc4b1701aa2923573adabceed486229abba5a2d (patch)
tree04a1b5eddcabd24e5c5a50a817fa50c5829972f2 /src/zencore/thread.cpp
parentZs/consul token (#870) (diff)
downloadzen-7cc4b1701aa2923573adabceed486229abba5a2d.tar.xz
zen-7cc4b1701aa2923573adabceed486229abba5a2d.zip
add hub instance info (#869)
- Improvement: Hub module listing now includes per-instance process metrics (memory, CPU time, working set, pagefile usage) - Improvement: Hub now monitors provisioned instance health in the background and refreshes process metrics periodically - Improvement: Hub no longer exposes raw `StorageServerInstance` pointers to callers; instance state is returned as value snapshots (`Hub::InstanceInfo`) - Improvement: Hub instance access is now guarded by RAII per-instance locks (`SharedLockedPtr`/`ExclusiveLockedPtr`), preventing concurrent modifications during provisioning and deprovisioning - Improvement: Hub instance lifecycle is now tracked as a `HubInstanceState` enum covering transitional states (Provisioning, Deprovisioning, Hibernating, Waking); exposed as a string in the HTTP API and dashboard
Diffstat (limited to 'src/zencore/thread.cpp')
-rw-r--r--src/zencore/thread.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/zencore/thread.cpp b/src/zencore/thread.cpp
index 54459cbaa..f74791333 100644
--- a/src/zencore/thread.cpp
+++ b/src/zencore/thread.cpp
@@ -146,6 +146,12 @@ RwLock::AcquireShared() noexcept
m_Mutex.lock_shared();
}
+bool
+RwLock::TryAcquireShared() noexcept
+{
+ return m_Mutex.try_lock_shared();
+}
+
void
RwLock::ReleaseShared() noexcept
{
@@ -158,6 +164,12 @@ RwLock::AcquireExclusive() noexcept
m_Mutex.lock();
}
+bool
+RwLock::TryAcquireExclusive() noexcept
+{
+ return m_Mutex.try_lock();
+}
+
void
RwLock::ReleaseExclusive() noexcept
{