| 1152 | } |
| 1153 | |
| 1154 | void any_executor_execute_test() |
| 1155 | { |
| 1156 | int count = 0; |
| 1157 | thread_pool pool(1); |
| 1158 | execution::any_executor< |
| 1159 | execution::blocking_t::possibly_t, |
| 1160 | execution::blocking_t::never_t, |
| 1161 | execution::outstanding_work_t::untracked_t, |
| 1162 | execution::outstanding_work_t::tracked_t, |
| 1163 | execution::relationship_t::continuation_t> |
| 1164 | ex(pool.executor()); |
| 1165 | |
| 1166 | ex.execute(bindns::bind(increment, &count)); |
| 1167 | |
| 1168 | boost::asio::require(ex, boost::asio::execution::blocking.possibly).execute( |
| 1169 | bindns::bind(increment, &count)); |
| 1170 | |
| 1171 | boost::asio::require(ex, boost::asio::execution::blocking.never).execute( |
| 1172 | bindns::bind(increment, &count)); |
| 1173 | |
| 1174 | boost::asio::require(ex, |
| 1175 | boost::asio::execution::blocking.never, |
| 1176 | boost::asio::execution::outstanding_work.tracked |
| 1177 | ).execute(bindns::bind(increment, &count)); |
| 1178 | |
| 1179 | boost::asio::require(ex, |
| 1180 | boost::asio::execution::blocking.never, |
| 1181 | boost::asio::execution::outstanding_work.untracked |
| 1182 | ).execute(bindns::bind(increment, &count)); |
| 1183 | |
| 1184 | boost::asio::require(ex, |
| 1185 | boost::asio::execution::blocking.never, |
| 1186 | boost::asio::execution::outstanding_work.untracked, |
| 1187 | boost::asio::execution::relationship.continuation |
| 1188 | ).execute(bindns::bind(increment, &count)); |
| 1189 | |
| 1190 | pool.wait(); |
| 1191 | |
| 1192 | BOOST_ASIO_CHECK(count == 6); |
| 1193 | } |
| 1194 | |
| 1195 | BOOST_ASIO_TEST_SUITE |
| 1196 | ( |