Abstract base class for a source of thread workers. More...
Public Member Functions | |
asio::io_service & | io_service () |
Returns the underlying io_service. | |
template<class R > | |
void | enqueue (enqueued_task< R > task) |
Sends a task to the thread pool for execution. | |
template<class F > | |
shared_future< typename std::result_of< F()>::type > | enqueue (F f) |
Sends some callable entity to the thread pool for execution. | |
Protected Member Functions | |
thread_source (asio::io_service &_service) | |
thread_source & | operator= (const thread_source &) |
Protected Attributes | |
asio::io_service & | service |
Abstract base class for a source of thread workers.
Note that in Boost 1.54, and possibly later versions, `asio::io_service` on Windows appears to dislike being destructed during static data deinit, hence why this inherits from `std::enable_shared_from_this<>` in order that it may be reference count deleted before static data deinit occurs.
asio::io_service& boost::afio::thread_source::io_service | ( | ) |
void boost::afio::thread_source::enqueue | ( | enqueued_task< R > | task | ) |
shared_future<typename std::result_of<F()>::type> boost::afio::thread_source::enqueue | ( | F | f | ) |
January, 2014 |
Copyright © 2013-2014 Niall Douglas, Cork, Ireland Copyright © 2013 Paul Kirth, California |