diff options
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sparc')
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h | 3 | ||||
-rw-r--r-- | nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h index b947439e34..d123fd059f 100644 --- a/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h @@ -1,5 +1,5 @@ /* Machine-specific pthread type layouts. SPARC version. - Copyright (C) 2003 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. @@ -76,6 +76,7 @@ typedef union #if __WORDSIZE != 64 unsigned int __nusers; #endif + int __spins; } __data; char __size[__SIZEOF_PTHREAD_MUTEX_T]; long int __align; diff --git a/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/sparc/lowlevellock.h index 76ec431a6c..05bc5a2974 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 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. @@ -86,6 +86,14 @@ __lll_mutex_trylock (int *futex) } #define lll_mutex_trylock(futex) __lll_mutex_trylock (&(futex)) +static inline int +__attribute__ ((always_inline)) +__lll_mutex_cond_trylock (int *futex) +{ + return atomic_compare_and_exchange_val_acq (futex, 2, 0) != 0; +} +#define lll_mutex_cond_trylock(futex) __lll_mutex_cond_trylock (&(futex)) + extern void __lll_lock_wait (int *futex) attribute_hidden; @@ -124,7 +132,7 @@ __lll_mutex_timedlock (int *futex, const struct timespec *abstime) { int val = atomic_compare_and_exchange_val_acq (futex, 1, 0); int result = 0; - + if (__builtin_expect (val != 0, 0)) result = __lll_timedlock_wait (futex, abstime); return result; |