public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Thread-specific data
@ 1999-06-18 11:57 Jamie Guinan
  1999-06-21  2:33 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Jamie Guinan @ 1999-06-18 11:57 UTC (permalink / raw)
  To: ecos-discuss

Hello,

I have a question about thread-specific data in eCos.

I have a library in which I would like to associate
an integer value with the calling thread.

Can the value returned by cyg_thread_new_data_index()
be shared by all threads that want to index thread-specific 
data based on a specific key?

In other words, is it true that the cyg_ucount32 returned
by cyg_thread_new_data_index() is _not_ a per-thread datum 
itself?  I would hope not, but I just wanted to clarify the 
issue.

Thanks,
-Jamie

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Thread-specific data
  1999-06-18 11:57 [ECOS] Thread-specific data Jamie Guinan
@ 1999-06-21  2:33 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 1999-06-21  2:33 UTC (permalink / raw)
  To: guinan; +Cc: ecos-discuss

In article < Pine.LNX.3.96.990618144410.26479B-100000@newt.home.net > you write:
>
>In other words, is it true that the cyg_ucount32 returned
>by cyg_thread_new_data_index() is _not_ a per-thread datum 
>itself?  I would hope not, but I just wanted to clarify the 
>issue.

Yes, it (quite sensibly) is not a per-thread value itself :-).

The map of free thread data indexes can be found in the Cyg_Thread class
in kernel/v1_2_1/include/thread.hxx as:

    // Map of free thread_data indexes. Each bit represents an index
    // and is 1 if that index is free, and 0 if it is in use.
    static cyg_ucount32        thread_data_map;

The "static" stops it from being thread-specific.

HTH,

Jifl
-- 
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-06-21  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-18 11:57 [ECOS] Thread-specific data Jamie Guinan
1999-06-21  2:33 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).