diff options
author | Jakub Jelinek <jakub@redhat.com> | 2003-05-30 13:46:04 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2003-05-30 13:46:04 +0000 |
commit | ef276e64724bd5db5acf46913c0a424b0bc9ca06 (patch) | |
tree | 525b4ddf17d9cb37aba0671854892c4467ba65f2 /nptl | |
parent | 586d174837d85006bb64199f2ba15830f83ee28a (diff) | |
download | glibc-ef276e64724bd5db5acf46913c0a424b0bc9ca06.tar.gz glibc-ef276e64724bd5db5acf46913c0a424b0bc9ca06.tar.xz glibc-ef276e64724bd5db5acf46913c0a424b0bc9ca06.zip |
(__lll_mutex_cond_lock): New function. (lll_mutex_cond_lock): Define.
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index 4d95319f1c..7934c0ed96 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -142,6 +142,19 @@ __lll_mutex_lock (int *futex) } #define lll_mutex_lock(futex) __lll_mutex_lock (&(futex)) +static inline void +__attribute__ ((always_inline)) +__lll_mutex_cond_lock (int *futex) +{ + int oldval; + int newval; + + lll_compare_and_swap (futex, oldval, newval, "lr %2,%1; ahi %2,2"); + if (oldval > 0) + ___lll_mutex_lock (futex, newval); +} +#define lll_mutex_cond_lock(futex) __lll_mutex_cond_lock (&(futex)) + extern int ___lll_mutex_timedlock (int *, const struct timespec *, int) attribute_hidden; |