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: Calling cyg_thread_create() from static constructors


Hi Uwe,

I think it should be possible to create and resume a thread from a
static constructor, but you have to ensure that scheduler object has
been created before, otherwise the initiliazation of the scheduler
will overwrite the activation of your thread.

Ciao, Fabian

2006/2/6, uwe.kindler@cetoni.de <uwe.kindler@cetoni.de>:
> Hello,
>
> is it allowed in eCos to call cyg_thread_create() and cyg_thread_resume() from static constructors?
>
> I have the following problem. My C++ application contains a static object. This object creates a thread with cyg_thread_create() and then calls cyg_thread_resume() in its constructor.
>
> I single stepped the function cyg_hal_invoke_constructors(). As soon as this object is created (it is the last one that is constructed cyg_hal_invoke_constructors()) it is not possible to view the list of threads from insight or GDB any longer. If I select View, Thread List in insight, I get an empty thread list or an error message that it was not possible to get thread list. If I remove this object from my application, then this problem does not occur.
>
> Is there any solution for this problem or should I simply not call these two function from a static constructor?.
>
> Thank you for your help.
>
> Uwe Kindler
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>

--
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]