To avoid that this gets lost in the discussion about my xnlock
refactoring, here is a separate patch to fix the SMP behavior of
xnlock_put. OK to merge it into trunk and stable trees?

Jan
---
 ChangeLog                    |    4 ++++
 include/asm-generic/system.h |    6 ++++++
 2 files changed, 10 insertions(+)

Index: b/include/asm-generic/system.h
===================================================================
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -307,6 +307,12 @@ static inline void xnlock_put (xnlock_t 
 		    xnlock_stats[cpu].line = lock->line;
 	    }
 #endif /* XENO_DEBUG(NUCLEUS) */
+	    /*
+	     * Make sure all data written inside the lock is visible to
+	     * other CPUs before we release the lock.
+	     */
+	    xnarch_memory_barrier();
+
 	    atomic_set(&lock->owner, ~0);
     }
 #if XENO_DEBUG(NUCLEUS)
Index: b/ChangeLog
===================================================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-01  Jan Kiszka  <[EMAIL PROTECTED]>
+
+	* include/asm-generic/system.h (xnlock_put): Add proper barrier.
+
 2008-02-15  Gilles Chanteperdrix  <[EMAIL PROTECTED]>
 
 	* src/skins/posix/thread.c (__wrap_pthread_create): Follow more

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to