| 195 | template <typename Allocator, unsigned int Bits> |
| 196 | template <typename Function> |
| 197 | void thread_pool::basic_executor_type<Allocator, Bits>::do_bulk_execute( |
| 198 | ASIO_MOVE_ARG(Function) f, std::size_t n, false_type) const |
| 199 | { |
| 200 | typedef typename decay<Function>::type function_type; |
| 201 | typedef detail::bulk_executor_op<function_type, Allocator> op; |
| 202 | |
| 203 | // Allocate and construct operations to wrap the function. |
| 204 | detail::op_queue<detail::scheduler_operation> ops; |
| 205 | for (std::size_t i = 0; i < n; ++i) |
| 206 | { |
| 207 | typename op::ptr p = { detail::addressof(allocator_), |
| 208 | op::ptr::allocate(allocator_), 0 }; |
| 209 | p.p = new (p.v) op(ASIO_MOVE_CAST(Function)(f), allocator_, i); |
| 210 | ops.push(p.p); |
| 211 | |
| 212 | if ((bits_ & relationship_continuation) != 0) |
| 213 | { |
| 214 | ASIO_HANDLER_CREATION((*pool_, *p.p, |
| 215 | "thread_pool", pool_, 0, "bulk_execute(blk=never,rel=cont)")); |
| 216 | } |
| 217 | else |
| 218 | { |
| 219 | ASIO_HANDLER_CREATION((*pool_, *p.p, |
| 220 | "thread_pool", pool_, 0, "bulk)execute(blk=never,rel=fork)")); |
| 221 | } |
| 222 | |
| 223 | p.v = p.p = 0; |
| 224 | } |
| 225 | |
| 226 | pool_->scheduler_.post_immediate_completions(n, |
| 227 | ops, (bits_ & relationship_continuation) != 0); |
| 228 | } |
| 229 | |
| 230 | template <typename Function> |
| 231 | struct thread_pool_always_blocking_function_adapter |
no test coverage detected