From: Philippe Gerum <rpm@xenomai.org>
To: Tomas Kalibera <kalibera@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Suspended task resumed without rt_task_resume ?
Date: Mon, 14 Apr 2008 10:21:38 +0200 [thread overview]
Message-ID: <48031412.2000409@domain.hid> (raw)
In-Reply-To: <4802D528.5090404@domain.hid>
Tomas Kalibera wrote:
> Hi,
>
> what can, besides an explicit call, resume a suspended task ? I created
> and started a child task, then shadowed the current thread with T_SUSP
> flag. The child was supposed to call rt_task_resume to wake-up the
> parent and let it terminate the process, but, the parent was resumed
> before this call. The call to rt_task_suspend in parent returned 0. The
> program uses SIGALRM signal. Could this be the cause ?
>
Yes, but the syscall should be silently restarted by default. This patch should
fix the issue:
--- ksrc/skins/native/task.c (revision 3698)
+++ ksrc/skins/native/task.c (working copy)
@@ -410,11 +410,17 @@
* A nesting count is maintained so that rt_task_suspend() and
* rt_task_resume() must be used in pairs.
*
+ * Receiving a Linux signal causes the suspended task to resume
+ * immediately.
+ *
* @param task The descriptor address of the affected task. If @a task
* is NULL, the current task is suspended.
*
* @return 0 is returned upon success. Otherwise:
*
+ * - -EINTR is returned if a Linux signal has been received by the
+ * suspended task.
+ *
* - -EINVAL is returned if @a task is not a task descriptor.
*
* - -EPERM is returned if the addressed @a task is not allowed to sleep
@@ -463,9 +469,12 @@
goto unlock_and_exit;
}
- if (task->suspend_depth++ == 0)
+ if (task->suspend_depth++ == 0) {
xnpod_suspend_thread(&task->thread_base, XNSUSP,
XN_INFINITE, XN_RELATIVE, NULL);
+ if (xnthread_test_info(task, XNBREAK))
+ err = -EINTR;
+ }
unlock_and_exit:
--
Philippe.
next prev parent reply other threads:[~2008-04-14 8:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-14 3:53 [Xenomai-help] Suspended task resumed without rt_task_resume ? Tomas Kalibera
2008-04-14 8:21 ` Philippe Gerum [this message]
2008-04-14 8:26 ` Philippe Gerum
2008-04-14 20:01 ` Tomas Kalibera
2008-04-14 20:32 ` Philippe Gerum
2008-04-14 20:50 ` Tomas Kalibera
2008-04-15 7:20 ` Philippe Gerum
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=48031412.2000409@domain.hid \
--to=rpm@xenomai.org \
--cc=kalibera@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.