From a2d83cfb21ddeef7dda1656521438db6f352330c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 27 Feb 2003 19:49:35 +0000 Subject: [PATCH] Update. * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT. (reader_thread): Likewise. --- nptl/ChangeLog | 3 +++ nptl/tst-rwlock9.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index e81af68..c1f0a2b 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,5 +1,8 @@ 2003-02-27 Ulrich Drepper + * tst-rwlock9.c (writer_thread): Correct adding TIMEOUT. + (reader_thread): Likewise. + * sysdeps/pthread/pthread_rwlock_unlock.c (__pthread_rwlock_unlock): Release internal lock early. Don't try to wake up readers if there are none. diff --git a/nptl/tst-rwlock9.c b/nptl/tst-rwlock9.c index adbf672..a5522ce 100644 --- a/nptl/tst-rwlock9.c +++ b/nptl/tst-rwlock9.c @@ -62,6 +62,11 @@ writer_thread (void *nr) TIMEVAL_TO_TIMESPEC (&tv, &ts); ts.tv_nsec += 2 * TIMEOUT; + if (ts.tv_nsec >= 1000000000) + { + ts.tv_nsec -= 1000000000; + ++ts.tv_sec; + } printf ("writer thread %ld tries again\n", (long int) nr); @@ -111,6 +116,11 @@ reader_thread (void *nr) TIMEVAL_TO_TIMESPEC (&tv, &ts); ts.tv_nsec += TIMEOUT; + if (ts.tv_nsec >= 1000000000) + { + ts.tv_nsec -= 1000000000; + ++ts.tv_sec; + } printf ("reader thread %ld tries again\n", (long int) nr); -- 2.7.4