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

Function TEST_F

test/scoped_lock_unittest.cpp:34–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32};
33
34TEST_F(ScopedLockTest, mutex) {
35 pthread_mutex_t m1 = PTHREAD_MUTEX_INITIALIZER;
36 {
37 BAIDU_SCOPED_LOCK(m1);
38 ASSERT_EQ(EBUSY, pthread_mutex_trylock(&m1));
39 }
40 ASSERT_EQ(0, pthread_mutex_trylock(&m1));
41 pthread_mutex_unlock(&m1);
42}
43
44TEST_F(ScopedLockTest, spinlock) {
45 pthread_spinlock_t s1;

Callers

nothing calls this directly

Calls 10

pthread_mutex_trylockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
pthread_spin_initFunction · 0.85
pthread_spin_trylockFunction · 0.85
pthread_spin_lockFunction · 0.85
pthread_spin_unlockFunction · 0.85
pthread_spin_destroyFunction · 0.85
unlockMethod · 0.45
owns_lockMethod · 0.45
try_lockMethod · 0.45

Tested by

no test coverage detected