This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Thread specific data
Tom Coremans wrote:
>
> Hi,
>
> 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?
*Strictly* yes call the function. In practice you could use a fixed slot.
You could reuse a fixed slot allocated to something else if you aren't
using the particular package, e.g. uItron (see under the
CYGNUM_KERNEL_THREADS_DATA_ALL option).
Or you could add a new one by upping CYGNUM_KERNEL_THREADS_DATA_ALL to 31,
upping CYGNUM_KERNEL_THREADS_DATA_MAX a bit and use any key from 4-7
inclusive.
> 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 could know that, you wouldn't need to call it ;-).
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss