diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-03-18 05:31:53 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-03-18 05:31:53 +0000 |
commit | 4773086e0498c99ee11422fc39606e9a53f12502 (patch) | |
tree | 3fe27fef04df3b0f2fd09d99898d5e412266e86a /nptl/sysdeps/unix/sysv/linux/lowlevellock.c | |
parent | 970269474a7a5c5fe515adc6d55aeb2a796b73dd (diff) | |
download | glibc-4773086e0498c99ee11422fc39606e9a53f12502.tar glibc-4773086e0498c99ee11422fc39606e9a53f12502.tar.gz glibc-4773086e0498c99ee11422fc39606e9a53f12502.tar.bz2 glibc-4773086e0498c99ee11422fc39606e9a53f12502.zip |
Update.
* sysdeps/unix/sysv/linux/ia64/pthread_once.c: Use __builtin_expect.
Use __lll_add instead of spelling it out. Use protected symbol names.
* sysdeps/unix/sysv/linux/ia64/sem_post.c: Use __builtin_expect.
Use __lll_add.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h (__lll_compare_and_swap):
Renamed from lll_compare_and_swap. Use new name where necessary.
(__lll_add): Defined.
(__lll_dec_if_positive): Defined.
(__lll_test_and_set): Defined.
* sysdeps/ia64/pthread_spin_init.c: Removed.
* sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Removed.
* sysdeps/unix/sysv/linux/ia64/sem_trywait.c: Removed.
* sysdeps/unix/sysv/linux/ia64/sem_wait.c: Removed.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Removed.
* sysdeps/unix/sysv/linux/ia64/libc-lowlevellock.c: Removed.
* sysdeps/unix/sysv/linux/ia64/libc-lowlevelmutex.c: Removed.
* sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Removed.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/lowlevellock.c')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/lowlevellock.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c index cdde262384..49d68da702 100644 --- a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c +++ b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c @@ -83,11 +83,10 @@ hidden_proto (__lll_timedlock_wait) int lll_unlock_wake_cb (int *futex) { - if (__lll_add (futex, -1) - 1 != 0) - { - *futex = 0; - lll_futex_wake (futex, 1); - } + int val = __lll_test_and_set (futex, 0); + + if (__builtin_expect (val > 1, 0)) + lll_futex_wake (futex, 1); return 0; } |