[ 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.kis...@siemens.com>
---

 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: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to