From b7641115fbe9a19dd964a033fc59a0892fde225a Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 20 Aug 2023 16:50:54 +0200 Subject: [PATCH] Block-Flow: integrate actual Gate-implementation Each Epoch in the memory manager holds a Gate in the first slot; after the logic for Gate-activation is worked out now, we can switch to using this actual logic to determine when an Epoch can be released --- src/vault/gear/activity.hpp | 4 ++++ src/vault/gear/block-flow.hpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vault/gear/activity.hpp b/src/vault/gear/activity.hpp index c4273f4f9..53a6e448e 100644 --- a/src/vault/gear/activity.hpp +++ b/src/vault/gear/activity.hpp @@ -241,6 +241,10 @@ namespace gear { { int rest; ///< alive while rest > 0 Instant dead; ///< alive while time < dead + + bool isDead (Time now) const { return dead <= now;} + bool isHold () const { return rest > 0; } + bool isFree (Time now) const { return not (isHold() or isDead(now)); } }; /** Time window to define for activation */ diff --git a/src/vault/gear/block-flow.hpp b/src/vault/gear/block-flow.hpp index 9ca875afc..f8b4d38c6 100644 --- a/src/vault/gear/block-flow.hpp +++ b/src/vault/gear/block-flow.hpp @@ -260,8 +260,8 @@ namespace gear { bool isAlive (Time deadline) { - /////////////////////////////////////////////OOO preliminary implementation ... should use the GATE-Activity itself - return this->deadline() > deadline; + return data_.condition.isHold() // NOTE: expected callback keeps alive + or not data_.condition.isDead (deadline); } size_t