
13 Sep
2005
13 Sep
'05
4:29 p.m.
Calls through call_once are only atomic with respect to other calls that reference the same once_flag. If you want mutual exclusion, you need a shared mutex --- why not just create a function-local static mutex, lock it before your function call, and unlock it afterwards?
I hope not! There will be a race condition in the construction of the function-scope static mutex. John.