| 121 | }; |
| 122 | |
| 123 | void* waiter(void* arg) { |
| 124 | WaiterArg * wa = (WaiterArg*)arg; |
| 125 | const long t1 = butil::gettimeofday_us(); |
| 126 | const int rc = bthread::butex_wait( |
| 127 | wa->butex, wa->expected_value, wa->ptimeout); |
| 128 | const long t2 = butil::gettimeofday_us(); |
| 129 | if (rc == 0) { |
| 130 | EXPECT_EQ(wa->expected_result, 0) << bthread_self(); |
| 131 | } else { |
| 132 | EXPECT_EQ(wa->expected_result, errno) << bthread_self(); |
| 133 | } |
| 134 | LOG(INFO) << "after wait, time=" << (t2-t1) << "us"; |
| 135 | return NULL; |
| 136 | } |
| 137 | |
| 138 | TEST(ButexTest, sanity) { |
| 139 | const size_t N = 5; |
nothing calls this directly
no test coverage detected