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]

Re: kernel API calls allowed from cyg_user_start()?


Gary Thomas wrote:
> 
> That's what the warning is for.  You can't expect to do anything
> which might cause the thread to block, because there is no scheduler
> running, thus no way to get it restarted.
> 
> The safest thing to do is only use this routine to set up initial
> threads and then start the kernel.  Other things like creating and
> initializing kernel objects (mutexes, etc) are also safe, but not
> using them [in general].

Actually we do take some care to allow people to do things like lock/unlock
mutexes, as quite often you can't help "shared" code needing to do that. Of
course every lock must match an unlock. The kernel is deliberately set up
such that it thinks the current thread is the idle thread in order to do
that (even though it's on a different stack of course) and that the
scheduler is locked.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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