diff options
author | Florian Weimer <fweimer@redhat.com> | 2018-07-25 16:31:45 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2018-07-25 16:31:45 +0200 |
commit | d6b8f8470990db2d36b8e50f1055a673fdf1cea0 (patch) | |
tree | 1ba242d4123707db42c35a352ff4e95671e81d64 /nptl/tst-mtx-timedlock.c | |
parent | 25123a1c5c96429d70e75b85a9749b405909d7f2 (diff) | |
download | glibc-d6b8f8470990db2d36b8e50f1055a673fdf1cea0.tar glibc-d6b8f8470990db2d36b8e50f1055a673fdf1cea0.tar.gz glibc-d6b8f8470990db2d36b8e50f1055a673fdf1cea0.tar.bz2 glibc-d6b8f8470990db2d36b8e50f1055a673fdf1cea0.zip |
C11 threads: Fix timeout and locking issues
Diffstat (limited to 'nptl/tst-mtx-timedlock.c')
-rw-r--r-- | nptl/tst-mtx-timedlock.c | 5 |
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"); |