Subj : Re: reliability of setting thread priority To : comp.programming.threads From : gottlobfrege Date : Fri Feb 25 2005 04:48 am David Schwartz wrote: > wrote in message > news:1109230513.726588.207400@z14g2000cwz.googlegroups.com... > > > 2. I want/need it to work regardless of the order of static > > initialization - ie the intent is a StaticLocalCriticalSection, which > > may be created/declared in a function called *during* static > > initialization, so I can't be sure my global static mutex is created > > yet. (And I know that if the function is called during static init, > > then there is only one thread running and no need for the CS in the > > first place, but I don't *know* that it is called during static init, > > only that it *may* be.) > > > > Am I correct in my thinking? > > Your global static mutex doesn't need to be created. > > DS Sorry, I'm obviously missing something in your meaning - if the mutex doesn't "exist" what good is it to me? What do you mean 'created'? initted? something else? In Win32 I'm talking about calling CreateMutex(). I could wait and call CreateMutex() during the first usage, but then I'm back to needing a flag/exchange to protect that, and it starts to seem no better than what I already have. Tony .