From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH 3/3] native: Silent migration before self-deletion
Date: Thu, 26 Feb 2009 15:16:23 +0100 [thread overview]
Message-ID: <49A6A437.3080204@domain.hid> (raw)
Silently migrate to Linux domain before starting a task self-deletion so
that we don't raise SIGXCPU during tear-down if T_WARNSW is set.
Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---
src/skins/native/task.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/skins/native/task.c b/src/skins/native/task.c
index 24da8ef..f590b79 100644
--- a/src/skins/native/task.c
+++ b/src/skins/native/task.c
@@ -121,6 +121,9 @@ static void *rt_task_trampoline(void *cookie)
if (!err)
entry(cookie);
+ /* Silently migrate to avoid raising SIGXCPU on regular exit. */
+ XENOMAI_SYSCALL1(__xn_sys_migrate, XENOMAI_LINUX_DOMAIN);
+
fail:
pthread_exit((void *)err);
@@ -265,12 +268,18 @@ int rt_task_delete(RT_TASK *task)
{
int err;
- if (task && task->opaque2) {
+ if (!task || task->opaque == rt_task_self()->opaque) {
+ /* Silently migrate to avoid raising SIGXCPU. */
+ XENOMAI_SYSCALL1(__xn_sys_migrate, XENOMAI_LINUX_DOMAIN);
+
+ pthread_exit(NULL);
+ }
+
+ if (task->opaque2) {
err = pthread_cancel((pthread_t)task->opaque2);
if (err)
return -err;
- } else if (!task)
- pthread_exit(NULL);
+ }
err = XENOMAI_SKINCALL1(__native_muxid, __native_task_delete, task);
if (err == -ESRCH)
reply other threads:[~2009-02-26 14:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=49A6A437.3080204@domain.hid \
--to=jan.kiszka@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.