mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Update.
* tst-rwlock9.c (writer_thread): Correct adding TIMEOUT. (reader_thread): Likewise.
This commit is contained in:
parent
d2637c7053
commit
a2d83cfb21
@ -1,5 +1,8 @@
|
||||
2003-02-27 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* 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.
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user