The C ++ standard does not guarantee the security of static initialization streams - you should consider static initialization as requiring explicit synchronization.
Quote Alexander Gessler gives:
If the control enters the declaration at the same time while the object is initialized, simultaneous execution will wait for completion
from a draft C ++ 0x and does not reflect the current C ++ standard or the behavior of many C ++ compilers.
In the current C ++ standard, this passage states:
If the control re-enters the declaration (recursively) while the object is initialized, the behavior is undefined
source share