| 51 | } |
| 52 | |
| 53 | void* 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 | |
| 71 | struct A { |
| 72 | uint64_t a; |
nothing calls this directly
no test coverage detected