Home | Libraries | People | FAQ | More |
Abstract base class for a source of thread workers.
Note that in Boost 1.54, and possibly later versions,
on Windows appears
to dislike being destructed during static data deinit, hence why this inherits
from asio::io_service
in order that it may be reference count deleted before static data deinit
occurs.
std::enable_shared_from_this<>
class thread_source : public std::enable_shared_from_this< thread_source > { // ... };
Function |
Description |
Parameters |
Returns |
---|---|---|---|
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. |
enqueued_task< R >: task: |
|
template<class F> shared_future< typename std::result_of< F()>::type > enqueue(F f) |
Sends some callable entity to the thread pool for execution. |
F: f: Any instance of a callable type |
An enqueued task for the enqueued callable |
#include <boost/afio/v2/afio.hpp>