diff options
author | Agustina Arzille <avarzille@riseup.net> | 2016-10-18 00:20:45 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-11-05 18:46:00 +0100 |
commit | 8f03a364f803ad878ea3ab226fd2955ed4565495 (patch) | |
tree | da17acc70dae2d60327044fec8463298d1a6aa4e /sysdeps/mach/bits/spin-lock-inline.h | |
parent | b279c3618db5740e155c110e8dca395132b53ecd (diff) |
Make pthread_spinlock use gsync
* pthread/pt-spin-inlines.c (pthread_spin_lock): Define weak alias for
__pthread_spin_lock.
* sysdeps/mach/bits/spin-lock-inline.h: Include <lock-intern.h> instead
of <machine-lock.h>.
(__pthread_spin_trylock, __pthread_spin_unlock): Use __spin_lock_t type
instead of __lock.
(__pthread_spin_lock): Define as inline only, use __spin_lock and
__spin_lock_t type.
* sysdeps/mach/bits/spin-lock.h: Do not include <machine-lock.h>
(__pthread_spinlock_t): Use volatile int instead of __spin_lock_t.
(__PTHREAD_SPIN_LOCK_INITIALIZER): Define to 0.
* sysdeps/mach/i386/bits/spin-lock-inline.h: Remove file.
* sysdeps/mach/i386/bits/spin-lock.h: Remove file.
* sysdeps/posix/pt-spin.c (pthread_spin_lock, __pthread_spin_lock):
Remove weak aliases, provided by pt-spin-inlines.c
Diffstat (limited to 'sysdeps/mach/bits/spin-lock-inline.h')
-rw-r--r-- | sysdeps/mach/bits/spin-lock-inline.h | 14 |
1 files changed, 6 insertions, 8 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; } |