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]

Waitin Thread to finish


Hi,

There is no function in the C API to wait for a thread to finish.

What is the way to do so? 

I'm trying by polling the thread state, with a C API function like this:

externC cyg_uint32 cyg_thread_get_state(cyg_handle_t thread)
{
    return ((Cyg_Thread *)thread)->get_state();
}

But I will have a problem in many case:
- If the thread is not only exited but deleted, I will have a NULL pointer
somewhere. (but where?)
- If another thread, with the same handle, is created before I get a chance
to get the thread, I won't have seen the thread end.

Thanks

A+

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 



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