[PATCH 2/2] 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]>
---
 kernel/cobalt/thread.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index b605781c64..5626e7655f 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,15 @@ 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) {
 		if (mask & XNSUSP)
 			xnthread_set_info(thread, XNPNDSUSP);
 		if (mask & XNHELD)
-- 
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.