[sm_recursive] Fix atomicity when applying BOPs

Any BOP should be taken only once. Therefore, we should remove BOPs
that are being processed or had been processed from the uncommitted
list.
This commit is contained in:
Ming-Hung Tsai 2020-05-28 13:38:48 +08:00
parent 4cdffafe88
commit 86139cf6bd

View File

@ -212,9 +212,11 @@ namespace {
void flush_ops_() { void flush_ops_() {
recursing_lock lock(*this); recursing_lock lock(*this);
for (auto const &p : ops_) { while (!ops_.empty()) {
block_address b = p.first; auto p = ops_.begin();
auto const &op = p.second; block_address b = p->first;
auto op = p->second;
ops_.erase(p);
switch (op.op_) { switch (op.op_) {
case INC: case INC:
@ -230,7 +232,6 @@ namespace {
} }
} }
ops_.clear();
allocated_blocks_.clear(); allocated_blocks_.clear();
} }