summaryrefslogtreecommitdiffstats
path: root/include/framework/structure/MutableBuffer.h
diff options
context:
space:
mode:
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;
}