This is the mail archive of the ecos-discuss@sourceware.org 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: using threads causes exceptions


Gary Thomas <gary@mlbassoc.com> writes:

> On Wed, 2005-08-03 at 19:03 +0200, Stefan Sommerfeld wrote:

> > >> >> >> Program received signal SIGTRAP, Trace/breakpoint trap.
> > >> >> >> [Switching to Thread 2]
> > >> >> >> 0xa008c72c in main_stack ()

main_stack[] is defined in the POSIX compatibility package. This
package executes main() in a thread, so that it behaves compatibly
with other POSIX implementations.

In fact in most configurations where main() can be used, it is
executed in a thread. So, calling cyg_scheduler_start() again is
likely to corrupt the scheduler.

If you need control over when cyg_scheduler_start() is called, then do
your startup in cyg_start(). Alternatively use cyg_user_start() to
have the scheduler started automatically.


-- 
Nick Garnett                                     eCos Kernel Architect
http://www.ecoscentric.com                The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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