MCPcopy Create free account
hub / github.com/boostorg/asio / any_completion_executor_execute_test

Function any_completion_executor_execute_test

test/any_completion_executor.cpp:424–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424void any_completion_executor_execute_test()
425{
426 int count = 0;
427 thread_pool pool(1);
428 boost::asio::any_completion_executor ex(pool.executor());
429
430 ex.execute(bindns::bind(increment, &count));
431
432 boost::asio::prefer(ex, boost::asio::execution::blocking.possibly).execute(
433 bindns::bind(increment, &count));
434
435 boost::asio::prefer(ex,
436 boost::asio::execution::blocking.possibly,
437 boost::asio::execution::outstanding_work.tracked
438 ).execute(bindns::bind(increment, &count));
439
440 boost::asio::prefer(ex,
441 boost::asio::execution::blocking.possibly,
442 boost::asio::execution::outstanding_work.untracked
443 ).execute(bindns::bind(increment, &count));
444
445 boost::asio::prefer(ex,
446 boost::asio::execution::blocking.possibly,
447 boost::asio::execution::outstanding_work.untracked,
448 boost::asio::execution::relationship.continuation
449 ).execute(bindns::bind(increment, &count));
450
451 pool.wait();
452
453 BOOST_ASIO_CHECK(count == 5);
454}
455
456BOOST_ASIO_TEST_SUITE
457(

Callers

nothing calls this directly

Calls 5

bindFunction · 0.50
preferFunction · 0.50
executorMethod · 0.45
executeMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected