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

Method lock

src/bthread/mutex.cpp:1129–1136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1127}
1128
1129void FastPthreadMutex::lock() {
1130 if (try_lock()) {
1131 return;
1132 }
1133
1134 PTHREAD_MUTEX_CHECK_OWNER(_owner);
1135 (void)lock_contended(NULL);
1136}
1137
1138bool FastPthreadMutex::try_lock() {
1139 auto split = (bthread::MutexInternal*)&_futex;

Callers 15

SetMethod · 0.45
GetMethod · 0.45
popMethod · 0.45
pushMethod · 0.45
id_statusFunction · 0.45
bthread_id_cancelFunction · 0.45
bthread_id_joinFunction · 0.45
bthread_id_trylockFunction · 0.45
bthread_id_unlockFunction · 0.45

Calls 2

try_lockFunction · 0.85
pthread_mutex_lock_implFunction · 0.85

Tested by

no test coverage detected