summaryrefslogtreecommitdiff
path: root/nptl/tst-mtx-timedlock.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-07-25 16:31:45 +0200
committerFlorian Weimer <fweimer@redhat.com>2018-07-25 16:31:45 +0200
commitd6b8f8470990db2d36b8e50f1055a673fdf1cea0 (patch)
tree1ba242d4123707db42c35a352ff4e95671e81d64 /nptl/tst-mtx-timedlock.c
parent25123a1c5c96429d70e75b85a9749b405909d7f2 (diff)
C11 threads: Fix timeout and locking issues
Diffstat (limited to 'nptl/tst-mtx-timedlock.c')
-rw-r--r--nptl/tst-mtx-timedlock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/nptl/tst-mtx-timedlock.c b/nptl/tst-mtx-timedlock.c
index dcae828fb2..616db722eb 100644
--- a/nptl/tst-mtx-timedlock.c
+++ b/nptl/tst-mtx-timedlock.c
@@ -78,6 +78,11 @@ do_test (void)
/* Tiny amount of time, to assure that if any thread finds it busy.
It will receive thrd_timedout. */
wait_time.tv_nsec += 1;
+ if (wait_time.tv_nsec == 1000 * 1000 * 1000)
+ {
+ wait_time.tv_sec += 1;
+ wait_time.tv_nsec = 0;
+ }
if (thrd_create (&id, child_add, NULL) != thrd_success)
FAIL_EXIT1 ("thrd_create failed");