You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling front() and pop() when the queue is empty is undefined behavior.
There are no operations provided that check empty() and then access the container while holding the mutex the entire time.
If there are two threads that look like this:
while(true) {
if (!queue.empty()) {
queue.pop();
}
}
It is likely that the queue is not empty when one thread checks the conditional statement, but it is empty when it tries to call pop().
The text was updated successfully, but these errors were encountered:
Calling front() and pop() when the queue is empty is undefined behavior.
There are no operations provided that check empty() and then access the container while holding the mutex the entire time.
If there are two threads that look like this:
while(true) {
if (!queue.empty()) {
queue.pop();
}
}
It is likely that the queue is not empty when one thread checks the conditional statement, but it is empty when it tries to call pop().
The text was updated successfully, but these errors were encountered: