summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-08-02 20:40:14 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2008-08-02 20:40:14 +0000
commit665c887871534907014e7c0c049e8ec23e057f94 (patch)
treec77ecec944f0a18a52175b97e2a7ab746c217556
parentc5690f093fc468335c7665b2368b8d61068dab48 (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.
-rw-r--r--libthreads/ChangeLog4
-rw-r--r--libthreads/i386/cthreads.h11
2 files changed, 13 insertions, 2 deletions
diff --git a/libthreads/ChangeLog b/libthreads/ChangeLog
index 720ad5a8..f0898498 100644
--- a/libthreads/ChangeLog
+++ b/libthreads/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-02 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * i386/cthreads.h (spin_unlock, spin_try_lock): Add memory clobbers.
+
2007-06-14 Thomas Schwinge <tschwinge@gnu.org>
* cthread_internals.h (cproc_block): Add prototype.
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() \