[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_() {
recursing_lock lock(*this);
for (auto const &p : ops_) {
block_address b = p.first;
auto const &op = p.second;
while (!ops_.empty()) {
auto p = ops_.begin();
block_address b = p->first;
auto op = p->second;
ops_.erase(p);
switch (op.op_) {
case INC:
@ -230,7 +232,6 @@ namespace {
}
}
ops_.clear();
allocated_blocks_.clear();
}