스레드에서 공유 변수를 변경하는 코드가 왜 경쟁 조건을 겪지 않는 것입니까? Cygwin GCC를 사용하고 있으며이 코드를 실행합니다. #include #include #include using namespace std; unsigned u = 0; void foo() { u++; } int main() { vector threads; for(int i = 0; i < 1000; i++) { threads.push_back (thread (foo)); } for (auto& t : threads) t.join(); cout