| 157 | template <typename Blocking, typename Relationship, typename Allocator> |
| 158 | template <typename Function, typename OtherAllocator> |
| 159 | void basic_system_executor<Blocking, Relationship, Allocator>::defer( |
| 160 | Function&& f, const OtherAllocator& a) const |
| 161 | { |
| 162 | system_context& ctx = detail::global<system_context>(); |
| 163 | |
| 164 | // Allocate and construct an operation to wrap the function. |
| 165 | typedef detail::executor_op<decay_t<Function>, OtherAllocator> op; |
| 166 | typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; |
| 167 | p.p = new (p.v) op(static_cast<Function&&>(f), a); |
| 168 | |
| 169 | BOOST_ASIO_HANDLER_CREATION((ctx, *p.p, |
| 170 | "system_executor", &this->context(), 0, "defer")); |
| 171 | |
| 172 | ctx.scheduler_.post_immediate_completion(p.p, true); |
| 173 | p.v = p.p = 0; |
| 174 | } |
| 175 | #endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS) |
| 176 | |
| 177 | BOOST_ASIO_INLINE_NAMESPACE_END |
nothing calls this directly
no test coverage detected