2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-26 19:12:11 +00:00

fix wait_pull_front in case the queue is closed while empty.

This commit is contained in:
Vicente J. Botet Escriba
2014-07-06 18:47:48 +02:00
parent 6e154d45a4
commit f263c6014e

View File

@@ -320,7 +320,9 @@ namespace boost
{
if (closed(lk)) return queue_op_status::closed;
}
wait_until_not_empty(lk);
bool has_been_closed = false;
wait_until_not_empty(lk, has_been_closed);
if (has_been_closed) return queue_op_status::closed;
pull_front(elem, lk);
return queue_op_status::success;
}