Bugfix: Slice at the correct height.

This commit is contained in:
bubnikv 2018-10-31 20:02:07 +01:00
parent 64c95677de
commit da37094a09
3 changed files with 16 additions and 12 deletions

View file

@ -135,14 +135,16 @@ public:
bool invalidated = false;
for (size_t i = 0; i < COUNT; ++ i)
if (m_state[i].load(std::memory_order_relaxed) != INVALID) {
if (! invalidated) {
mtx.unlock();
cancel();
mtx.lock();
invalidated = true;
}
m_state[i].store(INVALID, std::memory_order_relaxed);
invalidated = true;
break;
}
if (invalidated) {
mtx.unlock();
cancel();
for (size_t i = 0; i < COUNT; ++ i)
m_state[i].store(INVALID, std::memory_order_relaxed);
mtx.lock();
}
return invalidated;
}