From: Jan Kiszka <jan.kiszka@domain.hid>
To: Dmitry Adamushko <dmitry.adamushko@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] [PATCH] relax context check for rt_task_suspend
Date: Wed, 12 Jul 2006 16:30:09 +0200 [thread overview]
Message-ID: <44B50771.9080003@domain.hid> (raw)
In-Reply-To: <b647ffbd0607120645n69a20805rfb9e62c8cfb3061f@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 1286 bytes --]
Dmitry Adamushko wrote:
> --- task.c 2006-05-19 18:25:19.000000000 +0200
> +++ task-my.c 2006-07-12 15:40:16.549170000 +0200
> @@ -426,7 +426,8 @@ int rt_task_suspend(RT_TASK *task)
> goto unlock_and_exit;
> }
>
>
> - if (xnpod_unblockable_p()) {
> + /* we are about to suspend a task, let's check wehther it may sleep */
> + if (xnthread_test_flags(task, XNLOCK|XNROOT)) {
> err = -EPERM;
> goto unlock_and_exit;
> }
>
>
>
> See the difference? :) it was slightly broken indeed, meaning it just
> bailed
> out all the calls from the interrupt context which is wrong according to
> spec.
Fine, now I achieved what I always wanted: someone really thought about
it! :)
I tried to bundle your approach with appropriate documentation update
and a minor fix in the attached patch. Credits go to you then.
>
> maybe something like xnthread_task_unblockable/blockable(task) would be
> also of avail.
>
>
> Oh, my dear. I should stop hacking patches while talking to colleagues.
>> Does this one make more sense?
>>
>
> maybe it's better that the other way around? I mean, writting good code and
> saying nonsense to your collegues... :o>
Who said I was talking witted stuff to them?
Jan
[-- Attachment #1.2: suspend-foreign-task-from-any-context-v3.patch --]
[-- Type: text/plain, Size: 1069 bytes --]
Index: ksrc/skins/native/task.c
===================================================================
--- ksrc/skins/native/task.c (revision 1323)
+++ ksrc/skins/native/task.c (working copy)
@@ -391,9 +391,8 @@ 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 the addressed @a task is not allowed to sleep
+ * (e.g. in interrupt context, non-realtime task, or scheduler locked).
*
* - -EIDRM is returned if @a task is a deleted task descriptor.
*
@@ -432,7 +431,8 @@ int rt_task_suspend(RT_TASK *task)
goto unlock_and_exit;
}
- if (xnpod_unblockable_p()) {
+ /* We are about to suspend a task, let's check whether it may sleep */
+ if (xnthread_test_flags(&task->thread_base, XNLOCK|XNROOT)) {
err = -EPERM;
goto unlock_and_exit;
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-07-12 14:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2006-07-12 15:55 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44B50771.9080003@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=dmitry.adamushko@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.