| 40 | } |
| 41 | |
| 42 | result<void> insert(executor_tag, |
| 43 | std::shared_ptr<executor> ex, |
| 44 | async_lock& lock, |
| 45 | std::vector<size_t>& vec, |
| 46 | size_t range_begin, |
| 47 | size_t range_end, |
| 48 | std::chrono::time_point<std::chrono::system_clock> tp) { |
| 49 | |
| 50 | std::this_thread::sleep_until(tp); |
| 51 | |
| 52 | for (size_t i = range_begin; i < range_end; i++) { |
| 53 | auto lk = co_await lock.lock(ex); |
| 54 | vec.emplace_back(i); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void async_increment(runtime& runtime) { |
| 59 | async_lock mtx; |