| 32 | }; |
| 33 | |
| 34 | TEST_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 | |
| 44 | TEST_F(ScopedLockTest, spinlock) { |
| 45 | pthread_spinlock_t s1; |
nothing calls this directly
no test coverage detected