📜  什么是竞争条件 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:12.304000             🧑  作者: Mango

代码示例1
if (x == 5) // The "Check"
{
   y = x * 2; // The "Act"

   // If another thread changed x in between "if (x == 5)" and "y = x * 2" above,
   // y will not be equal to 10.
}