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

Function locker

test/bthread_id_unittest.cpp:215–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215static void* locker(void* arg) {
216 bthread_id_t id = { (uintptr_t)arg };
217 butil::Timer tm;
218 tm.start();
219 EXPECT_EQ(0, bthread_id_lock(id, NULL));
220 bthread_usleep(2000);
221 EXPECT_EQ(0, bthread_id_unlock(id));
222 tm.stop();
223 LOG(INFO) << "Unlocked, tm=" << tm.u_elapsed();
224 return NULL;
225}
226
227TEST(BthreadIdTest, id_lock) {
228 bthread_id_t id1;

Callers

nothing calls this directly

Calls 5

bthread_usleepFunction · 0.85
bthread_id_unlockFunction · 0.85
u_elapsedMethod · 0.80
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected