This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Is main() a normal thread ?
- From: Claudio Leonel <cls at elaxys dot com dot br>
- To: ecos-discuss at sources dot redhat dot com
- Date: Fri, 26 Sep 2003 19:01:38 +0000
- Subject: [ECOS] Is main() a normal thread ?
Hi all,
I thought main() was a normal thread but if I ran the
following application step by step in gdb there is no
return from the function cyg_thread_delay(). Apparently
it hangs in the call to cyg_thread_delay().
int main(void) {
while (1) {
cyg_thread_delay(100);
}
}
But if I start a thread from cyg_user_start() I can
single step through cyg_thread_delay() in thread funcT1():
cyg_thread thread_s;
char stack[4096];
cyg_handle_t hThread;
void funcT1(cyg_addrword_t data) {
while (1) {
cyg_thread_delay(100);
}
}
void cyg_user_start(void) {
cyg_thread_create(4, funcT1, 0, "T1",
(void *)stack, 4096, &hThread, &thread_s);
cyg_thread_resume(hThread);
}
------------------------------------------------------
Is this the normal behaviour or is there something wrong
with my configuration ?
Regards,
Claudio L. Salvadori
Elaxys Tecnologia
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss