summaryrefslogtreecommitdiffstats
path: root/include/framework/structure/MutableBuffer.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-10-20 17:00:42 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2023-10-20 17:00:42 -0400
commit7ecfb22c32b7986ed1a2439c1abbeed298e4153a (patch)
treed7207b5755ce987068620b71f9b4af9a52982c0d /include/framework/structure/MutableBuffer.h
parent1a47cbd7978dcad7ed0b2f2af3f933137eedbfa3 (diff)
downloaddynamic-extension-7ecfb22c32b7986ed1a2439c1abbeed298e4153a.tar.gz
Initial pass w/ new scheduler setup
currently there's a race condition of some type to sort out.
Diffstat (limited to 'include/framework/structure/MutableBuffer.h')
-rw-r--r--include/framework/structure/MutableBuffer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/framework/structure/MutableBuffer.h b/include/framework/structure/MutableBuffer.h
index 9f12175..804ca5e 100644
--- a/include/framework/structure/MutableBuffer.h
+++ b/include/framework/structure/MutableBuffer.h
@@ -90,12 +90,23 @@ public:
}
bool truncate() {
+
+ while (active_merge() || m_refcnt.load() > 0)
+ ;
+
+ m_merge_lock.lock();
+
+ while (m_refcnt > 0)
+ ;
+
m_tombstonecnt.store(0);
m_reccnt.store(0);
m_weight.store(0);
m_max_weight.store(0);
if (m_tombstone_filter) m_tombstone_filter->clear();
+ m_merge_lock.unlock();
+
return true;
}