Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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_elapsed
Method · 0.80
start
Method · 0.45
stop
Method · 0.45
Tested by
no test coverage detected