diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-09-22 21:30:25 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-09-22 21:30:25 +0000 |
commit | 39358e8b2bbf78b3ee50027abcd12837473b5f9f (patch) | |
tree | c579eb3fe367bd09bf4c07e9dfa6060c1f3bb79c /nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h | |
parent | c0df57e1ce270466be342d9998f72633764b22dc (diff) | |
download | glibc-39358e8b2bbf78b3ee50027abcd12837473b5f9f.tar glibc-39358e8b2bbf78b3ee50027abcd12837473b5f9f.tar.gz glibc-39358e8b2bbf78b3ee50027abcd12837473b5f9f.tar.bz2 glibc-39358e8b2bbf78b3ee50027abcd12837473b5f9f.zip |
Update.
2003-09-22 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/lowlevellock.c (__lll_timedlock_wait): Use
lll_futex_timed_wait instead of lll_futex_wait.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c: Removed.
* sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Removed.
* sysdeps/unix/sysv/linux/s390/libc-lowlevellock.c: Removed.
* sysdeps/unix/sysv/linux/s390/libc-lowlevelmutex.c: Removed.
* sysdeps/unix/sysv/linux/s390/sem_trywait.c: Removed.
* sysdeps/unix/sysv/linux/s390/sem_wait.c: Removed.
* sysdeps/unix/sysv/linux/s390/sem_post.c: Removed.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Removed.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Include atomic.h.
Completely revamp the locking macros. No distinction between
normal and mutex locking anymore.
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_lock_wait,
__lll_lock_timedwait): Fix prototypes.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (__lll_lock_wait,
__lll_lock_timedwait): Likewise.
(lll_mutex_lock, lll_mutex_cond_lock): Use _val instead of _bool
macros, add __builtin_expect.
(lll_mutex_timedlock): Likewise. Fix return value.
* sysdeps/unix/sysv/linux/i386/i486/libc-lowlevelmutex.S: Removed.
* sysdeps/unix/sysv/linux/i386/i586/libc-lowlevelmutex.S: Removed.
* sysdeps/unix/sysv/linux/i386/i586/lowlevelmutex.S: Removed.
* sysdeps/unix/sysv/linux/i386/i686/libc-lowlevelmutex.S: Removed.
* sysdeps/unix/sysv/linux/i386/i686/lowlevelmutex.S: Removed.
* sysdeps/unix/sysv/linux/x86_64/libc-lowlevelmutex.S: Removed.
* sysdeps/unix/sysv/linux/lowlevelmutex.c: Removed.
* sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: Removed.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h index 0caee0cd1f..a715879dbd 100644 --- a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h @@ -101,30 +101,35 @@ #define lll_mutex_trylock(lock) __lll_trylock (&(lock)) -extern void __lll_lock_wait (int *futex, int val) attribute_hidden; +extern void __lll_lock_wait (int *futex) attribute_hidden; #define lll_mutex_lock(lock) \ (void) ({ \ int *__futex = &(lock); \ - if (atomic_compare_and_exchange_bool_acq (__futex, 1, 0) != 0) \ + if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, 1, 0),\ + 0) != 0) \ __lll_lock_wait (__futex); \ }) #define lll_mutex_cond_lock(lock) \ (void) ({ \ int *__futex = &(lock); \ - if (atomic_compare_and_exchange_bool_acq (__futex, 2, 0) != 0) \ + if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, 2, 0),\ + 0) != 0) \ __lll_lock_wait (__futex); \ }) extern int __lll_timedlock_wait - (int *futex, int val, const struct timespec *) attribute_hidden; + (int *futex, const struct timespec *) attribute_hidden; #define lll_mutex_timedlock(lock, abstime) \ - (void) ({ \ + ({ \ int *__futex = &(lock); \ - if (atomic_compare_and_exchange_bool_acq (__futex, 1, 0) != 0) \ - __lll_timedlock_wait (__futex, abstime); \ + int __val = 0; \ + if (__builtin_expect (atomic_compare_and_exchange_val_acq (__futex, 1, 0),\ + 0) != 0) \ + __val = __lll_timedlock_wait (__futex, abstime); \ + __val; \ }) #define lll_mutex_unlock(lock) \ |