I'm using Boost's lockfree queue for a producer-consumer queue. I'd like each consumer thread to block when the queue is empty, waking up either when there's more data in the queue, or any producer terminates. But Boost doesn't seem to offer a blocking pop
, only an immediate returning pop
.
How should consumers wait until data is available?