diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-09-12 11:44:01 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-09-12 11:44:01 +0000 |
commit | 30aa57851a93d6efd6493c5a29cf82f58083bdf4 (patch) | |
tree | 98b5c02208d0b53238de1d51ecf4cc83fb5e653b /nptl | |
parent | 41aba3d764a72e48fa5bb08969653582c38f319f (diff) | |
download | glibc-30aa57851a93d6efd6493c5a29cf82f58083bdf4.tar.gz glibc-30aa57851a93d6efd6493c5a29cf82f58083bdf4.tar.xz glibc-30aa57851a93d6efd6493c5a29cf82f58083bdf4.zip |
[BZ #2526, BZ #3138, BZ #3143]
2006-09-12 Jakub Jelinek <jakub@redhat.com> [BZ #2526] * README.libm: Fix a thinko in sqrt algorithm description. [BZ #3143] * manual/string.texi (argz_delete): Fix prototype. Patch by <alpt@freaknet.org>. 2006-08-26 Joseph Myers <joseph@codesourcery.com> [BZ #3138] * io/test-lfs.c (do_prepare): Give name_len type size_t. * io/tst-fcntl.c (do_prepare): Likewise. * posix/tst-exec.c (do_prepare): Likewise. * posix/tst-preadwrite.c (do_prepare): Likewise. * posix/tst-spawn.c (do_prepare): Likewise. * posix/tst-truncate.c (do_prepare): Likewise. * rt/tst-aio.c (do_prepare): Likewise. * rt/tst-aio64.c (do_prepare): Likewise. * stdlib/test-canon2.c (do_prepare): Give test_dir_len type size_t.
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/ChangeLog | 5 | ||||
-rw-r--r-- | nptl/tst-cond22.c | 25 |
2 files changed, 21 insertions, 9 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index c269f3daaa..6c7fd49b85 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2006-09-12 Ulrich Drepper <drepper@redhat.com> + + * tst-cond22.c (tf): Slight changes to the pthread_cond_wait use + to guarantee the thread is always canceled. + 2006-09-08 Jakub Jelinek <jakub@redhat.com> * tst-cond22.c: Include pthread.h instead of pthreadP.h. diff --git a/nptl/tst-cond22.c b/nptl/tst-cond22.c index 1094c09068..e7c8d01b5e 100644 --- a/nptl/tst-cond22.c +++ b/nptl/tst-cond22.c @@ -30,17 +30,24 @@ tf (void *arg) exit (1); } pthread_cleanup_push (cl, NULL); - if (pthread_cond_wait (&c, &m) != 0) - { - printf ("%s: cond_wait failed\n", __func__); - exit (1); + /* We have to loop here because the cancellation might come after + the cond_wait call left the cancelable area and is then waiting + on the mutex. In this case the beginning of the second cond_wait + call will cause the cancellation to happen. */ + while (1) + { + if (pthread_cond_wait (&c, &m) != 0) + { + printf ("%s: cond_wait failed\n", __func__); + exit (1); + } + if (pthread_mutex_unlock (&m) != 0) + { + printf ("%s: mutex_unlock failed\n", __func__); + exit (1); + } } pthread_cleanup_pop (0); - if (pthread_mutex_unlock (&m) != 0) - { - printf ("%s: mutex_unlock failed\n", __func__); - exit (1); - } return NULL; } |