From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] libnative: Avoid double-evaluation of rt_task_self()
Date: Thu, 02 Apr 2009 21:36:56 +0200 [thread overview]
Message-ID: <49D513D8.5020001@domain.hid> (raw)
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
[ can be pulled from git.xenomai.org/xenomai-jki.git queues/assorted ]
Keep the result of rt_task_self() in a local variable to avoid the
second invocation.
Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
---
src/skins/native/task.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/skins/native/task.c b/src/skins/native/task.c
index 905d366..149717b 100644
--- a/src/skins/native/task.c
+++ b/src/skins/native/task.c
@@ -247,10 +247,11 @@ int rt_task_resume(RT_TASK *task)
int rt_task_delete(RT_TASK *task)
{
+ RT_TASK *self;
int err;
if (task == NULL ||
- (rt_task_self() && task->opaque == rt_task_self()->opaque)) {
+ ((self = rt_task_self()) && self->opaque == task->opaque)) {
/* Silently migrate to avoid raising SIGXCPU. */
XENOMAI_SYSCALL1(__xn_sys_migrate, XENOMAI_LINUX_DOMAIN);
pthread_exit(NULL);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next reply other threads:[~2009-04-02 19:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-02 19:36 Jan Kiszka [this message]
2009-04-02 21:40 ` [Xenomai-core] [PATCH] libnative: Avoid double-evaluation of rt_task_self() Gilles Chanteperdrix
2009-04-02 21:45 ` Philippe Gerum
2009-04-04 7:37 ` Jan Kiszka
2009-04-04 9:18 ` Philippe Gerum
2009-04-13 16:13 ` Jan Kiszka
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=49D513D8.5020001@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=rpm@xenomai.org \
--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.