Skip to content
Snippets Groups Projects
Commit e8fcfd97 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

[UnboundedBlockingMpscQueue] Add another assert

parent edb64d5a
No related branches found
No related tags found
No related merge requests found
......@@ -83,10 +83,16 @@ class UnboundedBlockingMpscQueue : public Blockable<LogSubsystem::U_B_MPSC_Q> {
});
if (!tPopped) {
std::lock_guard<std::mutex> lock(queueMutex);
// If we observed tPopped to be false without holding the
// queueMutex, then the same must be true when holding the
// mutex.
assert(!tPopped);
// If 't' isn't already set, then mspcQueue.get() MUST
// return an element. Note that a non-lineralizabe
// queue may break this invariant.
assert(!mpscQueue.empty());
t = mpscQueue.front();
mpscQueue.pop();
postRetrieve();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment