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

Function TEST

test/bthread_butex_unittest.cpp:38–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37namespace {
38TEST(ButexTest, wait_on_already_timedout_butex) {
39 uint32_t* butex = bthread::butex_create_checked<uint32_t>();
40 ASSERT_TRUE(butex);
41 timespec now;
42 ASSERT_EQ(0, clock_gettime(CLOCK_REALTIME, &now));
43 *butex = 1;
44 ASSERT_EQ(-1, bthread::butex_wait(butex, 1, &now));
45 ASSERT_EQ(ETIMEDOUT, errno);
46}
47
48void* sleeper(void* arg) {
49 bthread_usleep((uint64_t)arg);

Callers

nothing calls this directly

Calls 15

clock_gettimeFunction · 0.85
butex_waitFunction · 0.85
bthread_start_urgentFunction · 0.85
bthread_joinFunction · 0.85
berrorFunction · 0.85
butex_destroyFunction · 0.85
butex_wakeFunction · 0.85
seconds_from_nowFunction · 0.85
bthread_usleepFunction · 0.85
bthread_stopFunction · 0.85
bthread_start_backgroundFunction · 0.85
bthread_flushFunction · 0.85

Tested by

no test coverage detected