From 665c887871534907014e7c0c049e8ec23e057f94 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 2 Aug 2008 20:40:14 +0000 Subject: 2008-08-02 Samuel Thibault [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. --- libthreads/i386/cthreads.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libthreads/i386') 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 + * + * * 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 * @@ -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() \ -- cgit v1.2.3