| 297 | template <typename Allocator, unsigned int Bits> |
| 298 | template <typename Function, typename OtherAllocator> |
| 299 | void thread_pool::basic_executor_type<Allocator, Bits>::defer( |
| 300 | Function&& f, const OtherAllocator& a) const |
| 301 | { |
| 302 | typedef decay_t<Function> function_type; |
| 303 | |
| 304 | // Allocate and construct an operation to wrap the function. |
| 305 | typedef detail::executor_op<function_type, OtherAllocator> op; |
| 306 | typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; |
| 307 | p.p = new (p.v) op(static_cast<Function&&>(f), a); |
| 308 | |
| 309 | BOOST_ASIO_HANDLER_CREATION((*pool_, *p.p, |
| 310 | "thread_pool", pool_, 0, "defer")); |
| 311 | |
| 312 | pool_->scheduler_.post_immediate_completion(p.p, true); |
| 313 | p.v = p.p = 0; |
| 314 | } |
| 315 | #endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS) |
| 316 | |
| 317 | BOOST_ASIO_INLINE_NAMESPACE_END |
nothing calls this directly
no test coverage detected