Commit 531ecd69 authored by Jan Kiszka's avatar Jan Kiszka Committed by Philippe Gerum
Browse files

cobalt/synch: Clear PP boost prior to handing over the ownership



Otherwise we first add the synch object to the new owner's boost list
before we remove it from the old one's, corrupting the list.
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent a472084e
......@@ -942,6 +942,11 @@ bool xnsynch_release(struct xnsynch *synch, struct xnthread *curr)
*/
xnlock_get_irqsave(&nklock, s);
if (synch->status & XNSYNCH_PP) {
clear_pp_boost(synch, curr);
need_resched = true;
}
h = atomic_cmpxchg(lockp, currh, XN_NO_HANDLE);
if ((h & ~XNSYNCH_FLCEIL) != currh)
/* FLCLAIM set, synch is contended. */
......@@ -949,11 +954,6 @@ bool xnsynch_release(struct xnsynch *synch, struct xnthread *curr)
else if (h != currh) /* FLCEIL set, FLCLAIM clear. */
atomic_set(lockp, XN_NO_HANDLE);
if (synch->status & XNSYNCH_PP) {
clear_pp_boost(synch, curr);
need_resched = true;
}
xnlock_put_irqrestore(&nklock, s);
return need_resched;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment