| 193 | }; |
| 194 | |
| 195 | void* wait_butex(void* void_arg) { |
| 196 | ButexWaitArg* arg = static_cast<ButexWaitArg*>(void_arg); |
| 197 | const timespec ts = butil::milliseconds_from_now(arg->wait_msec); |
| 198 | int rc = bthread::butex_wait(arg->butex, arg->expected_val, &ts); |
| 199 | int saved_errno = errno; |
| 200 | if (arg->error_code) { |
| 201 | EXPECT_EQ(-1, rc); |
| 202 | EXPECT_EQ(arg->error_code, saved_errno); |
| 203 | } else { |
| 204 | EXPECT_EQ(0, rc); |
| 205 | } |
| 206 | return NULL; |
| 207 | } |
| 208 | |
| 209 | TEST(ButexTest, wait_without_stop) { |
| 210 | int* butex = bthread::butex_create_checked<int>(); |
nothing calls this directly
no test coverage detected