summaryrefslogtreecommitdiffstats
path: root/include/framework/scheduling/Epoch.h
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2023-10-31 11:48:56 -0400
committerDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2023-10-31 11:48:56 -0400
commit62792753bb4df2515e5e2d8cc48bca568c5379fd (patch)
treed9228c42e52fee4b952bac5b8640ba362c3b65fb /include/framework/scheduling/Epoch.h
parent28b036025d35853e2ff4ad0bd0c581768f93ece0 (diff)
downloaddynamic-extension-62792753bb4df2515e5e2d8cc48bca568c5379fd.tar.gz
Epoch: Creating an epoch now takes references on buffers + versions
When an epoch is created using the constructor Epoch(Structure, Buffer), it will call take_reference() on both. This was necessary to ensure that the destructor doesn't fail, as it releases references and fails if the refcnt is 0. It releases the user of the object from the burden of manually taking references in this situation.
Diffstat (limited to 'include/framework/scheduling/Epoch.h')
-rw-r--r--include/framework/scheduling/Epoch.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/framework/scheduling/Epoch.h b/include/framework/scheduling/Epoch.h
index 03cbb62..6bbf927 100644
--- a/include/framework/scheduling/Epoch.h
+++ b/include/framework/scheduling/Epoch.h
@@ -33,6 +33,8 @@ public:
, m_structure(structure)
, m_active_jobs(0)
{
+ structure->take_reference();
+ buff->take_reference();
m_buffers.push_back(buff);
}