diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2008-08-03 18:56:49 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2008-08-03 18:56:49 +0000 |
commit | 334b9a33a8adcddaf144e8285367c6753b7ab7ec (patch) | |
tree | 7305a085a080bb96f06bfed3b4c69c72842d1f40 /sysdeps/i386/bits/spin-lock.h | |
parent | 3bcc540d4c6c59dbfa5958d1b59942f8b610bf5e (diff) |
* Makefile (sysdeps_headers): Add spin-lock-inline.h.
(SYSDEP_PATH): Move sysdeps/i386 right after
sysdeps/$(MICROKERNEL)/i386.
* include/pthread/pthread.h: Include <bits/spin-lock-inline.h>.
* sysdeps/i386/bits/spin-lock.h: Move inlines to...
* sysdeps/i386/bits/spin-lock-inline.h: ... new file.
* sysdeps/mach/bits/spin-lock.h: Move inlines to...
* sysdeps/mach/bits/spin-lock-inline.h: ... new file.
Diffstat (limited to 'sysdeps/i386/bits/spin-lock.h')
-rw-r--r-- | sysdeps/i386/bits/spin-lock.h | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/sysdeps/i386/bits/spin-lock.h b/sysdeps/i386/bits/spin-lock.h index a306697..2662b6f 100644 --- a/sysdeps/i386/bits/spin-lock.h +++ b/sysdeps/i386/bits/spin-lock.h @@ -34,70 +34,6 @@ typedef __volatile int __pthread_spinlock_t; /* Initializer for a spin lock object. */ # define __SPIN_LOCK_INITIALIZER (0) -#if defined __USE_EXTERN_INLINES || defined _FORCE_INLINES - -# ifndef __EBUSY -# include <errno.h> -# define __EBUSY EBUSY -# endif - -# ifndef __PT_SPIN_INLINE -# define __PT_SPIN_INLINE __extern_inline -# endif - -__PT_SPIN_INLINE int __pthread_spin_destroy (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_destroy (__pthread_spinlock_t *__lock) -{ - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_init (__pthread_spinlock_t *__lock, - int __pshared); - -__PT_SPIN_INLINE int -__pthread_spin_init (__pthread_spinlock_t *__lock, int __pshared) -{ - *__lock = __SPIN_LOCK_INITIALIZER; - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_trylock (__pthread_spinlock_t *__lock) -{ - int __locked; - __asm__ __volatile ("xchgl %0, %1" - : "=&r" (__locked), "=m" (*__lock) : "0" (1) : "memory"); - return __locked ? __EBUSY : 0; -} - -__extern_inline int __pthread_spin_lock (__pthread_spinlock_t *__lock); -extern int _pthread_spin_lock (__pthread_spinlock_t *__lock); - -__extern_inline int -__pthread_spin_lock (__pthread_spinlock_t *__lock) -{ - if (__pthread_spin_trylock (__lock)) - return _pthread_spin_lock (__lock); - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_unlock (__pthread_spinlock_t *__lock) -{ - int __unlocked; - __asm__ __volatile ("xchgl %0, %1" - : "=&r" (__unlocked), "=m" (*__lock) : "0" (0) : "memory"); - return 0; -} - -#endif /* Use extern inlines or force inlines. */ - __END_DECLS #endif /* bits/spin-lock.h */ |