MCPcopy Create free account
hub / github.com/apache/brpc / wait_for

Method wait_for

src/bthread/condition_variable.h:82–85  ·  view source on GitHub ↗

Unlike std::condition_variable, we return ETIMEDOUT when time expires rather than std::timeout

Source from the content-addressed store, hash-verified

80 // Unlike std::condition_variable, we return ETIMEDOUT when time expires
81 // rather than std::timeout
82 int wait_for(std::unique_lock<bthread::Mutex>& lock,
83 long timeout_us) {
84 return wait_until(lock, butil::microseconds_from_now(timeout_us));
85 }
86
87 int wait_for(std::unique_lock<bthread_mutex_t>& lock,
88 long timeout_us) {

Callers 2

TEST_FFunction · 0.80
produce_funcFunction · 0.80

Calls 1

microseconds_from_nowFunction · 0.85

Tested by 2

TEST_FFunction · 0.64
produce_funcFunction · 0.64