Files
concurrency-in-action/source/listing_9.4.cpp
2018-10-18 00:40:34 -05:00

12 lines
160 B
C++

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