We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb3cd9b commit 33ee1f8Copy full SHA for 33ee1f8
libc/test/integration/src/pthread/pthread_rwlock_test.cpp
@@ -162,7 +162,11 @@ static void timedlock_with_deadlock_test() {
162
timespec ts{};
163
ASSERT_EQ(LIBC_NAMESPACE::pthread_rwlock_rdlock(&rwlock), 0);
164
LIBC_NAMESPACE::clock_gettime(CLOCK_REALTIME, &ts);
165
- ts.tv_sec += 1;
+ ts.tv_nsec += 50'000;
166
+ if (ts.tv_nsec >= 1'000'000'000) {
167
+ ts.tv_nsec -= 1'000'000'000;
168
+ ts.tv_sec += 1;
169
+ }
170
ASSERT_EQ(LIBC_NAMESPACE::pthread_rwlock_timedwrlock(&rwlock, &ts),
171
ETIMEDOUT);
172
ASSERT_EQ(LIBC_NAMESPACE::pthread_rwlock_timedrdlock(&rwlock, &ts), 0);
0 commit comments