From 3e976b962a84255b70bcf6d9751a9a35d3e987ab Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 11 Mar 2003 22:02:29 +0000 Subject: Update. 2003-03-11 Ulrich Drepper * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S (__condvar_cleanup): Wake up all waiters in case we got signaled after being woken up but before disabling asynchronous cancellation. * sysdeps/pthread/pthread_cond_wait.c (__condvar_cleanup): Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (__condvar_cleanup): Likewise. * init.c (__NR_set_tid_address): If already defined, don't redefine. Make it an error if architecture has no #if case. Add x86-64. * sysdeps/unix/sysv/linux/x86_64/Makefile: Add flags for pt-initfini.s generation. * sysdeps/x86_64/tls.h: Include . (TLS_INIT_TP): Fix typo. --- nptl/sysdeps/pthread/pthread_cond_wait.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'nptl/sysdeps/pthread/pthread_cond_wait.c') diff --git a/nptl/sysdeps/pthread/pthread_cond_wait.c b/nptl/sysdeps/pthread/pthread_cond_wait.c index 399cee89ee..78fcc7f6c6 100644 --- a/nptl/sysdeps/pthread/pthread_cond_wait.c +++ b/nptl/sysdeps/pthread/pthread_cond_wait.c @@ -34,6 +34,7 @@ struct _condvar_cleanup_buffer pthread_mutex_t *mutex; }; + void __attribute__ ((visibility ("hidden"))) __condvar_cleanup (void *arg) @@ -49,6 +50,16 @@ __condvar_cleanup (void *arg) ++cbuffer->cond->__data.__wakeup_seq; ++cbuffer->cond->__data.__woken_seq; + /* Wake everybody to make sure no condvar signal gets lost. */ +#if BYTE_ORDER == LITTLE_ENDIAN + int *futex = ((int *) (&cbuffer->cond->__data.__wakeup_seq)); +#elif BYTE_ORDER == BIG_ENDIAN + int *futex = ((int *) (&cbuffer->cond->__data.__wakeup_seq)) + 1; +#else +# error "No valid byte order" +#endif + lll_futex_wake (futex, INT_MAX); + /* We are done. */ lll_mutex_unlock (cbuffer->cond->__data.__lock); -- cgit 1.4.1