diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-07-18 12:45:27 -0700 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-07-18 12:45:27 -0700 |
commit | f8b6cd2182494252fdddafe72331b631afac08d8 (patch) | |
tree | 3c67d427b4d8d02e811ce49c3c2d0732d5b5df9f /nptl/tst-cond11.c | |
parent | e88726b483a275824e852f64476087568dbae7bb (diff) | |
download | glibc-f8b6cd2182494252fdddafe72331b631afac08d8.zip glibc-f8b6cd2182494252fdddafe72331b631afac08d8.tar.gz glibc-f8b6cd2182494252fdddafe72331b631afac08d8.tar.bz2 |
Extend pthread_cond_timedwait tests.
Diffstat (limited to 'nptl/tst-cond11.c')
-rw-r--r-- | nptl/tst-cond11.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/nptl/tst-cond11.c b/nptl/tst-cond11.c index 0de4d56..4d0c7dd 100644 --- a/nptl/tst-cond11.c +++ b/nptl/tst-cond11.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -130,6 +130,20 @@ run_test (clockid_t cl) return 1; } + struct timespec ts2; + if (clock_gettime (cl, &ts2) != 0) + { + puts ("second clock_gettime failed"); + return 1; + } + + if (ts2.tv_sec < ts.tv_sec + || (ts2.tv_sec == ts.tv_sec && ts2.tv_nsec < ts.tv_nsec)) + { + puts ("timeout too short"); + return 1; + } + if (pthread_mutex_unlock (&mut) != 0) { puts ("mutex_unlock failed"); |