From: "M. Koehrer" <mathias_koehrer@domain.hid>
To: rpm@xenomai.org, mathias_koehrer@domain.hid
Cc: xenomai@xenomai.org, jan.kiszka@domain.hid
Subject: Re: Re: [Xenomai-help] Re: Re: What happens if task entry function
Date: Mon, 20 Nov 2006 08:52:38 +0100 (CET) [thread overview]
Message-ID: <1827213.1164009158538.JavaMail.ngmail@domain.hid> (raw)
In-Reply-To: <1163865143.4990.47.camel@domain.hid>
Hi Philppe,
thanks for the patch. Using this patch, my test application is working now!
I have also update to the latest SVN version (1882) of Xenomai.
Using this version, the application works perfectly, too.
Regards
Mathias
> > First, I give you some more information about the error.
> > The output is the following:
> > Hi, I am task A Hello
> > Hi, I am task B World
> > Main waits for A
> > This is the end of A
> > Main waits for B
> >
> > Then the system hangs.
> >
>
> Confirmed here on a two-way PIII. Well, _this_ was a nice one.
> Basically, the softlock was due to a missing rescheduling call after
> task A has exited, leaving task B in ready state, somewhere in the
> Twilight Zone. The patch below fixes it on my setup:
>
> --- ksrc/nucleus/shadow.c (revision 1854)
> +++ ksrc/nucleus/shadow.c (working copy)
> @@ -1631,7 +1631,8 @@
>
> static inline void do_taskexit_event(struct task_struct *p)
> {
> - xnthread_t *thread = xnshadow_thread(p); /* p == current */
> + xnthread_t *thread = xnshadow_thread(p); /* p == current */
> + spl_t s;
>
> if (!thread)
> return;
> @@ -1639,12 +1640,15 @@
> if (xnpod_shadow_p())
> xnshadow_relax(0);
>
> - /* So that we won't attempt to further wakeup the exiting task in
> - xnshadow_unmap(). */
> -
> + xnlock_get_irqsave(&nklock, s);
> + /* Prevent wakeup call from xnshadow_unmap(). */
> xnshadow_thrptd(p) = NULL;
> xnthread_archtcb(thread)->user_task = NULL;
> - xnpod_delete_thread(thread); /* Should indirectly call xnshadow_unmap().
> */
> + /* xnpod_delete_thread() -> hook -> xnshadow_unmap(). */
> + xnpod_delete_thread(thread);
> + xnsched_set_resched(thread->sched);
> + xnpod_schedule();
> + xnlock_put_irqrestore(&nklock, s);
>
> xnltt_log_event(xeno_ev_shadowexit, thread->name);
> }
>
> --
> Philippe.
>
>
>
--
Mathias Koehrer
mathias_koehrer@domain.hid
Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur 44,85 inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2
prev parent reply other threads:[~2006-11-20 7:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-17 12:14 [Xenomai-help] Re: Re: What happens if task entry function returns? M. Koehrer
2006-11-17 13:58 ` [Xenomai-help] " Jan Kiszka
2006-11-17 14:17 ` [Xenomai-help] " M. Koehrer
2006-11-17 15:00 ` Jan Kiszka
2006-11-17 15:28 ` M. Koehrer
2006-11-17 15:38 ` Jan Kiszka
2006-11-18 15:52 ` Philippe Gerum
2006-11-20 7:52 ` M. Koehrer [this message]
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=1827213.1164009158538.JavaMail.ngmail@domain.hid \
--to=mathias_koehrer@domain.hid \
--cc=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.