MCPcopy Create free account
hub / github.com/David-Haim/concurrencpp / insert

Function insert

test/source/thread_sanitizer/async_lock.cpp:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42result<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
58void async_increment(runtime& runtime) {
59 async_lock mtx;

Callers 1

async_insertFunction · 0.70

Calls 1

lockMethod · 0.80

Tested by

no test coverage detected