MCPcopy Create free account
hub / github.com/facebook/CacheLib / waitFor

Method waitFor

cachelib/navy/testing/SeqPoints.cpp:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57bool SeqPoints::waitFor(uint32_t idx, std::chrono::microseconds dur) {
58 auto until = std::chrono::steady_clock::now() + dur;
59 std::unique_lock<std::mutex> lock{mutex_};
60 log(Event::Wait, idx, points_[idx].name);
61 while (!points_[idx].reached) {
62 if (cv_.wait_until(lock, until) == std::cv_status::timeout) {
63 return false;
64 }
65 }
66 return true;
67}
68
69void SeqPoints::setName(uint32_t idx, std::string msg) {
70 std::lock_guard<std::mutex> lock{mutex_};

Callers 2

TESTFunction · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.64
TESTFunction · 0.64