
13 Sep
2005
13 Sep
'05
9:47 a.m.
How does call_once work? Does it maintain a separate mutex for each unique function pointer passed in, or is there only one global mutex shared by all calls to call_once? In other words, can call_once(foo, flag) block call_once(bar, flag2)?
The mutex is unique to both the calling process and the call_once flag, but not the function pointer (however there should always be a one to one correspondence between the once-flag and the function pointer). Hope this makes sense, John.