diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 13:29:44 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 13:29:44 +0000 |
commit | 13a4ee0bb4ccb6691729bde67233f5ca66209c7c (patch) | |
tree | 72d62fed4d091a1f38c021d9c3eab5e50044e8c4 /nptl/sysdeps/unix/sysv/linux/sparc | |
parent | 0923a2c896f09795cca4a6d800a336a56b0ee42c (diff) | |
download | glibc-13a4ee0bb4ccb6691729bde67233f5ca66209c7c.tar glibc-13a4ee0bb4ccb6691729bde67233f5ca66209c7c.tar.gz glibc-13a4ee0bb4ccb6691729bde67233f5ca66209c7c.tar.bz2 glibc-13a4ee0bb4ccb6691729bde67233f5ca66209c7c.zip |
[BZ #4745]
[BZ #4586]
[BZ #4702]
[BZ #4525]
[BZ #4514]
[BZ #4512]
Merge selected bugfixes from the trunk.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sparc')
5 files changed, 26 insertions, 17 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h index 6548970663..5013922a2f 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -240,6 +240,8 @@ __lll_robust_mutex_timedlock (int *futex, const struct timespec *abstime, /* Type for lock object. */ typedef int lll_lock_t; +extern int lll_unlock_wake_cb (int *__futex) attribute_hidden; + /* Initializers for lock. */ #define LLL_LOCK_INITIALIZER (0) #define LLL_LOCK_INITIALIZER_LOCKED (1) diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c b/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c index 83fedef8e8..3b07cc127d 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c +++ b/nptl/sysdeps/unix/sysv/linux/sparc/pthread_once.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -30,7 +30,7 @@ clear_once_control (void *arg) pthread_once_t *once_control = (pthread_once_t *) arg; *once_control = 0; - lll_private_futex_wake (once_control, INT_MAX); + lll_futex_wake (once_control, INT_MAX); } @@ -84,7 +84,7 @@ __pthread_once (once_control, init_routine) atomic_increment (once_control); /* Wake up all other threads. */ - lll_private_futex_wake (once_control, INT_MAX); + lll_futex_wake (once_control, INT_MAX); break; } diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c index cb9578b47b..a7611d6a88 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/lowlevellock.c @@ -1,5 +1,5 @@ /* low level locking for pthread library. SPARC version. - Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003. @@ -76,9 +76,21 @@ __lll_timedlock_wait (int *futex, const struct timespec *abstime) } -/* This function doesn't get included in libc.so */ +/* These don't get included in libc.so */ #ifdef IS_IN_libpthread int +lll_unlock_wake_cb (int *futex) +{ + int val = atomic_exchange_24_rel (futex, 0); + + if (__builtin_expect (val > 1, 0)) + lll_futex_wake (futex, 1); + + return 0; +} + + +int __lll_timedwait_tid (int *tidp, const struct timespec *abstime) { int tid; @@ -115,4 +127,5 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime) return 0; } + #endif diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c index 868e0d2819..4dfd11dcbe 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/pthread_barrier_wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003. @@ -52,9 +52,7 @@ pthread_barrier_wait (barrier) ++ibarrier->b.curr_event; /* Wake up everybody. */ - lll_futex_wake (&ibarrier->b.curr_event, INT_MAX, - // XYZ check mutex flag - LLL_SHARED); + lll_futex_wake (&ibarrier->b.curr_event, INT_MAX); /* This is the thread which finished the serialization. */ result = PTHREAD_BARRIER_SERIAL_THREAD; @@ -70,9 +68,7 @@ pthread_barrier_wait (barrier) /* Wait for the event counter of the barrier to change. */ do - lll_futex_wait (&ibarrier->b.curr_event, event, - // XYZ check mutex flag - LLL_SHARED); + lll_futex_wait (&ibarrier->b.curr_event, event); while (event == ibarrier->b.curr_event); } diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c index 527aedfdc7..be1cc60b11 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c +++ b/nptl/sysdeps/unix/sysv/linux/sparc/sparc32/sem_post.c @@ -1,5 +1,5 @@ /* sem_post -- post to a POSIX semaphore. SPARC version. - Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2003. @@ -39,9 +39,7 @@ __new_sem_post (sem_t *sem) nr = ++*futex; __sparc32_atomic_do_unlock24 (futex + 1); } - int err = lll_futex_wake (futex, nr, - // XYZ check mutex flag - LLL_SHARED); + int err = lll_futex_wake (futex, nr); if (__builtin_expect (err, 0) < 0) { __set_errno (-err); |