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.