diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2008-08-02 20:40:14 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2008-08-02 20:40:14 +0000 |
commit | 665c887871534907014e7c0c049e8ec23e057f94 (patch) | |
tree | c77ecec944f0a18a52175b97e2a7ab746c217556 /libthreads/i386/cthreads.h | |
parent | c5690f093fc468335c7665b2368b8d61068dab48 (diff) |
2008-08-02 Samuel Thibault <samuel.thibault@ens-lyon.org>
[libpthread]
* sysdeps/i386/bits/memory.h (__memory_barrier): Add memory clobber.
* sysdeps/i386/bits/spin-lock.h (__pthread_spin_trylock,
__pthread_spin_unlock): Add memory clobbers.
[libthreads]
* i386/cthreads.h (spin_unlock, spin_try_lock): Add memory clobbers.
Diffstat (limited to 'libthreads/i386/cthreads.h')
-rw-r--r-- | libthreads/i386/cthreads.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libthreads/i386/cthreads.h b/libthreads/i386/cthreads.h index d7202df6..694387b6 100644 --- a/libthreads/i386/cthreads.h +++ b/libthreads/i386/cthreads.h @@ -26,6 +26,13 @@ /* * HISTORY * $Log: cthreads.h,v $ + * Revision 1.3 2007/03/03 23:57:37 sthibaul + * 2006-03-04 Samuel Thibault <samuel.thibault@ens-lyon.org> + * + * * libpthread/sysdeps/i386/machine-sp.h (thread_stack_pointer): + * Optimize esp read. + * * libpthread/i386/cthreads.h (cthread_sp): Likewise. + * * Revision 1.2 2002/05/27 02:50:10 roland * 2002-05-26 Roland McGrath <roland@frob.com> * @@ -91,14 +98,14 @@ typedef volatile int spin_lock_t; ({ register int _u__ ; \ __asm__ volatile("xorl %0, %0; \n\ xchgl %0, %1" \ - : "=&r" (_u__), "=m" (*(p)) ); \ + : "=&r" (_u__), "=m" (*(p)) :: "memory" ); \ 0; }) #define spin_try_lock(p)\ (!({ boolean_t _r__; \ __asm__ volatile("movl $1, %0; \n\ xchgl %0, %1" \ - : "=&r" (_r__), "=m" (*(p)) ); \ + : "=&r" (_r__), "=m" (*(p)) :: "memory" ); \ _r__; })) #define cthread_sp() \ |