This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Problem with next_unique_id ?
- From: Ivan Djelic <ivan dot djelic at parrot dot fr>
- To: ecos-discuss at sources dot redhat dot com
- Date: Thu, 15 Jul 2004 11:27:22 +0200
- Subject: [ECOS] Problem with next_unique_id ?
Hi All,
Looking at eCos code I noticed that thread IDs are assigned using a static
global counter :
static cyg_uint16 next_unique_id = 1;
I also noticed that access to this counter is not protected with a mutex,
thus allowing several threads to get the same IDs in some situations...
Is this a bug or a deliberate feature ? ;-)
Regards,
Ivan
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss