This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: How to recognise that scheduler started.
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: Motoya Kurotsu <kurotsu at allied-telesis dot co dot jp>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 03 Jul 2003 10:37:53 +0100
- Subject: Re: [ECOS] How to recognise that scheduler started.
- References: <20030702174428.A30004@white.office1><m38yrhz1x8.fsf@miso.calivar.com><20030703141831.A13539@white.office1>
Please keep these discussions on the mailing list. It means that
others can see it.
Motoya Kurotsu <kurotsu@allied-telesis.co.jp> writes:
> Hi, Nick;
>
> Thanks for your suggestion.
>
> I would like to reassure that I correctly understood what you mean.
> For example, the following code is compliant with what you suggest?
>
> routine(cyg_handle_t thread)
> {
> if (thread != cyg_thread_idle_thread())
> use_kernel_serivices(); // e.g. wait on semaphore
> else
> no_use_kernel_serivices();
> }
>
> task
> {
> routine(cyg_thread_self());
> }
>
I was thinking more of just passing a boolean in:
routine(cyg_bool in_thread)
{
if (in_thread)
use_kernel_serivices(); // e.g. wait on semaphore
else
no_use_kernel_serivices();
}
And then setting the argument appropriately at the call sites.
Testing for the idle thread would not work since ISRs and DSRs could
be called while the idle thread is current.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss