| 213 | } |
| 214 | |
| 215 | static 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 | |
| 227 | TEST(BthreadIdTest, id_lock) { |
| 228 | bthread_id_t id1; |
nothing calls this directly
no test coverage detected