aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-05-30 13:46:04 +0000
committerJakub Jelinek <jakub@redhat.com>2003-05-30 13:46:04 +0000
commitef276e64724bd5db5acf46913c0a424b0bc9ca06 (patch)
tree525b4ddf17d9cb37aba0671854892c4467ba65f2 /nptl/sysdeps
parent586d174837d85006bb64199f2ba15830f83ee28a (diff)
downloadglibc-ef276e64724bd5db5acf46913c0a424b0bc9ca06.zip
glibc-ef276e64724bd5db5acf46913c0a424b0bc9ca06.tar.gz
glibc-ef276e64724bd5db5acf46913c0a424b0bc9ca06.tar.bz2
(__lll_mutex_cond_lock): New function. (lll_mutex_cond_lock): Define.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h13
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 4d95319..7934c0e 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;