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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Apr 11 18:23:48 2010 +0200

nucleus: fix relaxing synch owner detector

---

 ksrc/nucleus/synch.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c
index d57f7cd..7464951 100644
--- a/ksrc/nucleus/synch.c
+++ b/ksrc/nucleus/synch.c
@@ -996,9 +996,11 @@ void xnsynch_detect_relaxed_owner(struct xnsynch *synch, 
struct xnthread *sleepe
 
 /*
  * Detect when a thread is about to relax while holding a
- * synchronization object currently claimed by someone else. By
- * relying on the claim queue, we restrict the checks to PIP-enabled
- * objects, but that already covers most of the use cases anyway.
+ * synchronization object currently claimed by another thread, which
+ * bears the TWARNSW bit (thus advertising a concern about potential
+ * spurious relaxes and priority inversion). By relying on the claim
+ * queue, we restrict the checks to PIP-enabled objects, but that
+ * already covers most of the use cases anyway.
  */
 void xnsynch_detect_claimed_relax(struct xnthread *owner)
 {
@@ -1012,7 +1014,7 @@ void xnsynch_detect_claimed_relax(struct xnthread *owner)
                for (ht = getheadpq(&synch->pendq); ht != NULL;
                     ht = nextpq(&synch->pendq, ht)) {
                        sleeper = link2thread(ht, plink);
-                       if (xnthread_test_state(sleeper, XNRELAX)) {
+                       if (xnthread_test_state(sleeper, XNTRAPSW)) {
                                xnthread_set_state(sleeper, XNSWREP);
                                xnshadow_send_sig(sleeper, SIGDEBUG,
                                                  SIGDEBUG_MIGRATE_PRIOINV, 1);


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

Reply via email to