| 239 | } |
| 240 | |
| 241 | static void* failed_locker(void* arg) { |
| 242 | bthread_id_t id = { (uintptr_t)arg }; |
| 243 | int rc = bthread_id_lock(id, NULL); |
| 244 | if (rc == 0) { |
| 245 | bthread_usleep(2000); |
| 246 | EXPECT_EQ(0, bthread_id_unlock_and_destroy(id)); |
| 247 | return (void*)1; |
| 248 | } else { |
| 249 | EXPECT_EQ(EINVAL, rc); |
| 250 | return NULL; |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | TEST(BthreadIdTest, id_lock_and_destroy) { |
| 255 | bthread_id_t id1; |
nothing calls this directly
no test coverage detected