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

Method try_lock_until

src/bvar/utils/lock_timer.h:301–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299
300 template <class Clock, class Duration>
301 bool try_lock_until(
302 const std::chrono::time_point<Clock,Duration>& timeout_time ) {
303 _timer.start();
304 const bool rc = _lock.try_lock_until(timeout_time);
305 _timer.stop();
306 if (!rc) {
307 // Out of the criticle section. Otherwise the time will be recorded
308 // in unlock
309 *_mutex << _timer.u_elapsed();
310 }
311 return rc;
312 }
313#endif
314
315private:

Callers

nothing calls this directly

Calls 3

u_elapsedMethod · 0.80
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected