summaryrefslogtreecommitdiff
path: root/sysdeps/mach/bits
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2017-12-29 15:01:46 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2017-12-29 15:01:46 +0100
commit218db6679aea0dcf05fb60566cef6e18f706d9ba (patch)
tree3099f55335743748ff18bd435e4de25b22c8f54a /sysdeps/mach/bits
parent0a69b89843ec466fa20c994a29d13de6a45c3acb (diff)
parent7d4a84731cd80a1ef711c83535c6340f0e2b143f (diff)
Merge branch 'master' into 2.262.26
Diffstat (limited to 'sysdeps/mach/bits')
-rw-r--r--sysdeps/mach/bits/spin-lock-inline.h14
-rw-r--r--sysdeps/mach/bits/spin-lock.h7
2 files changed, 8 insertions, 13 deletions
diff --git a/sysdeps/mach/bits/spin-lock-inline.h b/sysdeps/mach/bits/spin-lock-inline.h
index f9f7c29..98e4b3b 100644
--- a/sysdeps/mach/bits/spin-lock-inline.h
+++ b/sysdeps/mach/bits/spin-lock-inline.h
@@ -22,7 +22,7 @@
#include <features.h>
#include <bits/spin-lock.h>
-#include <machine-lock.h> /* This does all the work. */
+#include <lock-intern.h> /* This does all the work. */
__BEGIN_DECLS
@@ -60,17 +60,15 @@ __PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock);
__PT_SPIN_INLINE int
__pthread_spin_trylock (__pthread_spinlock_t *__lock)
{
- return __spin_try_lock (__lock) ? 0 : __EBUSY;
+ return __spin_try_lock ((__spin_lock_t *) __lock) ? 0 : __EBUSY;
}
-__extern_inline int __pthread_spin_lock (__pthread_spinlock_t *__lock);
-extern int _pthread_spin_lock (__pthread_spinlock_t *__lock);
+__PT_SPIN_INLINE int __pthread_spin_lock (__pthread_spinlock_t *__lock);
-__extern_inline int
+__PT_SPIN_INLINE int
__pthread_spin_lock (__pthread_spinlock_t *__lock)
{
- if (__pthread_spin_trylock (__lock))
- return _pthread_spin_lock (__lock);
+ __spin_lock ((__spin_lock_t *) __lock);
return 0;
}
@@ -79,7 +77,7 @@ __PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock);
__PT_SPIN_INLINE int
__pthread_spin_unlock (__pthread_spinlock_t *__lock)
{
- __spin_unlock (__lock);
+ __spin_unlock ((__spin_lock_t *) __lock);
return 0;
}
diff --git a/sysdeps/mach/bits/spin-lock.h b/sysdeps/mach/bits/spin-lock.h
index 537dac9..7574b37 100644
--- a/sysdeps/mach/bits/spin-lock.h
+++ b/sysdeps/mach/bits/spin-lock.h
@@ -21,17 +21,14 @@
#define _BITS_SPIN_LOCK_H 1
#include <features.h>
-#include <machine-lock.h> /* This does all the work. */
__BEGIN_DECLS
/* The type of a spin lock object. */
-typedef __spin_lock_t __pthread_spinlock_t;
+typedef volatile int __pthread_spinlock_t;
/* Initializer for a spin lock object. */
-#ifndef __PTHREAD_SPIN_LOCK_INITIALIZER
-#error __PTHREAD_SPIN_LOCK_INITIALIZER undefined: should be defined by <lock-intern.h>.
-#endif
+#define __PTHREAD_SPIN_LOCK_INITIALIZER 0
__END_DECLS