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

Function rdlocker

test/bthread_rwlock_unittest.cpp:26–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24long start_time = butil::cpuwide_time_ms();
25int c = 0;
26void* rdlocker(void* arg) {
27 auto rw = (bthread_rwlock_t*)arg;
28 bthread_rwlock_rdlock(rw);
29 LOG(INFO) << butil::string_printf("[%" PRIu64 "] I'm rdlocker, %d, %" PRId64 "ms\n",
30 pthread_numeric_id(), ++c,
31 butil::cpuwide_time_ms() - start_time);
32 bthread_usleep(10000);
33 bthread_rwlock_unlock(rw);
34 return NULL;
35}
36
37void* wrlocker(void* arg) {
38 auto rw = (bthread_rwlock_t*)arg;

Callers

nothing calls this directly

Calls 6

bthread_rwlock_rdlockFunction · 0.85
string_printfFunction · 0.85
pthread_numeric_idFunction · 0.85
cpuwide_time_msFunction · 0.85
bthread_usleepFunction · 0.85
bthread_rwlock_unlockFunction · 0.85

Tested by

no test coverage detected