Module: xenomai-jki
Branch: for-upstream
Commit: d1da9640386a8b256e1475465d818ed87d5dc366
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=d1da9640386a8b256e1475465d818ed87d5dc366

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Mon Mar  1 18:00:00 2010 +0100

RTDM: Add smp barrier to rtdm_context_unlock

rtdm_context_unlock() is part of the driver API, and is therefore only
be called without holding the serializing rt_fildes_lock. Ensure proper
ordering of any access to the protected rtdm_dev_context by adding an
smp barrier for atomic_dec to rtdm_context_unlock().

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/rtdm/rtdm_driver.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/rtdm/rtdm_driver.h b/include/rtdm/rtdm_driver.h
index 1697b5c..0fc1496 100644
--- a/include/rtdm/rtdm_driver.h
+++ b/include/rtdm/rtdm_driver.h
@@ -554,6 +554,7 @@ static inline void rtdm_context_lock(struct 
rtdm_dev_context *context)
 
 static inline void rtdm_context_unlock(struct rtdm_dev_context *context)
 {
+       smp_mb__before_atomic_dec();
        atomic_dec(&context->close_lock_count);
 }
 


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

Reply via email to