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

Function failed_locker

test/bthread_id_unittest.cpp:241–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static 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
254TEST(BthreadIdTest, id_lock_and_destroy) {
255 bthread_id_t id1;

Callers

nothing calls this directly

Calls 2

bthread_usleepFunction · 0.85

Tested by

no test coverage detected