Skip to content

asio::thread_pool

A simple fixed-size thread pool.

詳細情報

メンバー

thread_pool()

Constructs a pool with an automatically determined number of threads.

ASIO_DECL asio::thread_pool::thread_pool()

戻り値

ASIO_DECL

thread_pool()

Constructs a pool with a specified number of threads.

ASIO_DECL asio::thread_pool::thread_pool(std::size_t num_threads)

引数

  • std::size_t num_threads

戻り値

ASIO_DECL

~thread_pool()

Destructor.

Automatically stops and joins the pool, if not explicitly done beforehand.

ASIO_DECL asio::thread_pool::~thread_pool()

戻り値

ASIO_DECL

get_executor()

Obtains the executor associated with the pool.

thread_pool::executor_type asio::thread_pool::get_executor() ASIO_NOEXCEPT

戻り値

executor_type

stop()

Stops the threads.

This function stops the threads as soon as possible. As a result of calling , pending function objects may be never be invoked.

ASIO_DECL void asio::thread_pool::stop()

戻り値

ASIO_DECLvoid

join()

Joins the threads.

This function blocks until the threads in the pool have completed. If is not called prior to , the call will wait until the pool has no more outstanding work.

ASIO_DECL void asio::thread_pool::join()

戻り値

ASIO_DECLvoid