This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to recognise that scheduler started.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]