add original source
This commit is contained in:
12
source/listing_9.4.cpp
Normal file
12
source/listing_9.4.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
void thread_pool::run_pending_task()
|
||||
{
|
||||
function_wrapper task;
|
||||
if(work_queue.try_pop(task))
|
||||
{
|
||||
task();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::this_thread::yield();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user