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]
Other format: [Raw text]

Re: thread specific data


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


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