about summary refs log tree commit diff
path: root/nptl/tst-rwlock9.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-27 19:49:35 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-27 19:49:35 +0000
commita2d83cfb21ddeef7dda1656521438db6f352330c (patch)
tree03c85f39c64d850fe14231f43c8687d1fd2e6aba /nptl/tst-rwlock9.c
parentd2637c70532ba49bf41b25c6aaf1b5d2b09d4aed (diff)
downloadglibc-a2d83cfb21ddeef7dda1656521438db6f352330c.tar.gz
glibc-a2d83cfb21ddeef7dda1656521438db6f352330c.tar.xz
glibc-a2d83cfb21ddeef7dda1656521438db6f352330c.zip
Update.
	* tst-rwlock9.c (writer_thread): Correct adding TIMEOUT.
	(reader_thread): Likewise.
Diffstat (limited to 'nptl/tst-rwlock9.c')
-rw-r--r--nptl/tst-rwlock9.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/nptl/tst-rwlock9.c b/nptl/tst-rwlock9.c
index adbf67224d..a5522ce484 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);