Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext
pool_executor_params::thread_safe

Creates a pool_executor_params object that makes pools thread-safe.

Synopsis
static
pool_executor_params
thread_safe(
    asio::any_io_executor ex);
Description

Creates an asio::strand object wrapping ex and uses it as the pool executor. Uses ex directly for the connections. The resulting configuration makes safe to call connection_pool::async_get_connection, connection_pool::async_run, connection_pool::cancel, ~pooled_connection and pooled_connection::return_without_reset concurrently from different threads.

Exception safety

Strong guarantee. Creating the strand may throw.


PrevUpHomeNext