Files
concurrency-in-action/source/listing_9.4.cpp
2014-04-22 21:54:16 -04:00

13 lines
185 B
C++

void thread_pool::run_pending_task()
{
function_wrapper task;
if(work_queue.try_pop(task))
{
task();
}
else
{
std::this_thread::yield();
}
}