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

Method timed_lock

src/bthread/mutex.cpp:1148–1153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1146}
1147
1148bool FastPthreadMutex::timed_lock(const struct timespec* abstime) {
1149 if (try_lock()) {
1150 return true;
1151 }
1152 return 0 == lock_contended(abstime);
1153}
1154
1155void FastPthreadMutex::unlock() {
1156 SUB_TLS_PTHREAD_LOCK_COUNT;

Callers 3

TESTFunction · 0.45

Calls 2

try_lockFunction · 0.85
pthread_mutex_lock_implFunction · 0.85

Tested by 2

TESTFunction · 0.36