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

Function joiner

test/bthread_butex_unittest.cpp:53–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void* joiner(void* arg) {
54 const long t1 = butil::gettimeofday_us();
55 for (bthread_t* th = (bthread_t*)arg; *th; ++th) {
56 if (0 != bthread_join(*th, NULL)) {
57 LOG(FATAL) << "fail to join thread_" << th - (bthread_t*)arg;
58 }
59 long elp = butil::gettimeofday_us() - t1;
60 EXPECT_LE(labs(elp - (th - (bthread_t*)arg + 1) * 100000L), 15000L)
61 << "timeout when joining thread_" << th - (bthread_t*)arg;
62 LOG(INFO) << "Joined thread " << *th << " at " << elp << "us ["
63 << bthread_self() << "]";
64 }
65 for (bthread_t* th = (bthread_t*)arg; *th; ++th) {
66 EXPECT_EQ(0, bthread_join(*th, NULL));
67 }
68 return NULL;
69}
70
71struct A {
72 uint64_t a;

Callers

nothing calls this directly

Calls 3

bthread_joinFunction · 0.85
bthread_selfFunction · 0.85
gettimeofday_usFunction · 0.70

Tested by

no test coverage detected