in Source/Shared/arcana/threading/blocking_concurrent_queue.h [111:133]
bool internal_drain(std::vector<T>& dest, const cancellation& cancel, bool block)
{
std::unique_lock<std::mutex> lock{ m_mutex };
if (block)
{
while (!cancel.cancelled() && m_data.empty())
{
m_dataReady.wait(lock);
}
}
if (m_data.empty() || cancel.cancelled())
return false;
while (!m_data.empty())
{
dest.emplace_back(std::move(m_data.front()));
m_data.pop();
}
return true;
}