[ECOS] thread specific data
Andrew Lunn
andrew.lunn@ascom.ch
Tue Feb 12 06:33:00 GMT 2002
On Tue, Feb 12, 2002 at 03:26:09PM +0100, Tom Coremans wrote:
> I want to use the cyg_thread_set_data (index, data) function in
> ecos. Do I have to call the cyg_thread_new_data_index() first to
> get an index or can I just use a random number as an index?
Some are pre-allocated to various things like the kernel, libc etc. If
you randomly pick one, expect random crashes.....
> And suspose I must use the cyg_thread_new_data_index first, is there
> a way of knowing wich index a will get??
If you knew what it was going to return, why call it?
Calling it ensure you get one eCos thinks no one else is using. Its
possible something else is just randomly picking an index an uses it,
so stomping over the data you put into it....
Andrew
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list