[PATCH v2] kernel/cobalt/thread: Confine condition for sending SIGSHADOW on xnthread_suspend

Jan Kiszka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
From: Jan Kiszka <[email protected]>

In fact, XNDELAY is only self-applied. Drop it from the condition set
and also fix the comment explaining this as well as some other bits.

Signed-off-by: Jan Kiszka <[email protected]>
---

Changes in v2:
 - rebased over next, without [1] as dependency (which will need a 
   broader approach)

[1] https://lore.kernel.org/xenomai/[email protected]/

 kernel/cobalt/thread.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 60a7112844..a51d9eca8d 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -996,7 +996,7 @@ void xnthread_suspend(struct xnthread *thread, int mask,
 	 * assumptions regarding suspended threads.
 	 *
 	 * We only care for threads that are not current, and for
-	 * XNSUSP, XNDELAY, XNDORMANT and XNHELD conditions, because:
+	 * XNSUSP and XNHELD conditions, because:
 	 *
 	 * - There is no point in dealing with a relaxed thread which
 	 * is current, since personalities have to ask for primary
@@ -1005,15 +1005,16 @@ void xnthread_suspend(struct xnthread *thread, int mask,
 	 *
 	 * - among all blocking bits (XNTHREAD_BLOCK_BITS), only
 	 * XNSUSP, XNDELAY, XNHELD and XNDBGSTOP may be applied by the
-	 * current thread to a non-current thread. XNPEND is always
-	 * added by the caller to its own state, XNMIGRATE, XNRELAX
-	 * and XNDBGSTOP have special semantics escaping this issue.
+	 * current thread to a non-current thread. XNPEND, XNDELAY and
+	 * XNDORMANT are always added by the caller to its own state,
+	 * XNMIGRATE, XNRELAX and XNDBGSTOP have special semantics
+	 * escaping this issue.
 	 *
 	 * We don't signal threads which are already in a dormant
 	 * state, since they are suspended by definition.
 	 */
 	if (((oldstate & (XNTHREAD_BLOCK_BITS|XNUSER)) == (XNRELAX|XNUSER)) &&
-	    (mask & (XNDELAY | XNSUSP | XNHELD)) != 0)
+	    (mask & (XNSUSP | XNHELD)) != 0)
 		__xnthread_signal(thread, SIGSHADOW, SIGSHADOW_ACTION_HARDEN);
 out:
 	xnlock_put_irqrestore(&nklock, s);
-- 
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.