Subj : Re: reliability of setting thread priority To : comp.programming.threads From : Alexander Terekhov Date : Thu Feb 24 2005 05:54 pm gottlobfrege@gmail.com wrote: [...] > In particular, similar to the problems of static local initializers > and implementing pthread_once, etc., I want to initialize a critical > section in a thread safe manner. http://groups.google.de/groups?selm=3FA61F96.223FDE85%40web.de > I would use another critical section > to guard the first CS, but that 'begs the question' as they say. :-) I > could use a global named mutex (CreateMutex() under Win32), but that > seems a bit heavy - and if I was going to use a mutex to make a > criticalsection, maybe I should just use a mutex where the CS was going > in the first place. Named mutex doesn't live long. It is used to serialize event creation/init (and initial lock state change). Once it is done, CloseHandle() is called. So what's your problem (priorities aside for a moment)? regards, alexander. .