void SystemInit()
{
cout << "SystemInit Call " << endl;
}
void SystemInitOne()
{
static std::once_flag flag;
std::call_once(flag, SystemInit);
}
int main()
{
for (int i = 1; i < 29; i++)
{
thread thread1(SystemInitOne);
thread1.detach();
}
}
显示只调用一次。