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

Method try_lock

src/bvar/utils/lock_timer.h:255–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 }
254
255 bool try_lock() {
256 _timer.start();
257 const bool rc = _lock.try_lock();
258 _timer.stop();
259 if (!rc) {
260 _mutex->recorder() << _timer.u_elapsed();
261 }
262 return rc;
263 }
264
265 void unlock() {
266 _lock.unlock();

Callers

nothing calls this directly

Calls 3

u_elapsedMethod · 0.80
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected