即,即使在多线程环境中,预计以下内容是否会正确执行?
int dostuff(void) { static int somevalue = 12345; return somevalue; }
或者是多个线程可以调用它,还有一个调用可以&somevalue在执行开始之前返回任何垃圾?
&somevalue
c++ static multithreading constants
c++ ×1
constants ×1
multithreading ×1
static ×1