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]

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


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