All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH] relax context check for rt_task_suspend
@ 2006-07-12  9:27 Jan Kiszka
  2006-07-12 12:00 ` Dmitry Adamushko
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Kiszka @ 2006-07-12  9:27 UTC (permalink / raw)
  To: xenomai-core


[-- Attachment #1.1: Type: text/plain, Size: 315 bytes --]

Hi,

given the existing doc of rt_task_suspend about allowed environments and
also when thinking about the logic behind it, I see no reason why
xnpod_unblockable_p() is also applied to task != NULL. This patch
confines the check to task == NULL and also tries to clarify the error
code documentation.

Jan

[-- Attachment #1.2: suspend-foreign-task-from-any-context.patch --]
[-- Type: text/plain, Size: 1066 bytes --]

Index: ksrc/skins/native/task.c
===================================================================
--- ksrc/skins/native/task.c	(revision 1323)
+++ ksrc/skins/native/task.c	(working copy)
@@ -391,9 +391,9 @@ int rt_task_start(RT_TASK *task, void (*
  *
  * - -EINVAL is returned if @a task is not a task descriptor.
  *
- * - -EPERM is returned if @a task is NULL but not called from a task
- * context, or this service was called from a context which cannot
- * sleep (e.g. interrupt, non-realtime or scheduler locked).
+ * - -EPERM is returned if @a task is NULL and this service was called
+ * from a context which cannot sleep (e.g. interrupt, non-realtime or
+ * scheduler locked).
  *
  * - -EIDRM is returned if @a task is a deleted task descriptor.
  *
@@ -430,9 +430,7 @@ int rt_task_suspend(RT_TASK *task)
 	if (!task) {
 		err = xeno_handle_error(task, XENO_TASK_MAGIC, RT_TASK);
 		goto unlock_and_exit;
-	}
-
-	if (xnpod_unblockable_p()) {
+	} else if (xnpod_unblockable_p()) {
 		err = -EPERM;
 		goto unlock_and_exit;
 	}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-07-12 15:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-12  9:27 [Xenomai-core] [PATCH] relax context check for rt_task_suspend Jan Kiszka
2006-07-12 12:00 ` Dmitry Adamushko
2006-07-12 12:25   ` Jan Kiszka
2006-07-12 12:33     ` Gilles Chanteperdrix
2006-07-12 13:31       ` Jan Kiszka
2006-07-12 14:44         ` Dmitry Adamushko
2006-07-12 14:56           ` Dmitry Adamushko
2006-07-12 13:45     ` Dmitry Adamushko
2006-07-12 14:30       ` Jan Kiszka
2006-07-12 15:55         ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.