一段有问题的代码,大概20%的概率,bStartSend的值的改变没有被检查到
//线程一直循环,等待消息 while (true) { if (bStartSend) { LogInfo("bStartSend=true"); StartMotor(ref ErrMsg, ref recvMsg, his.strCurrentCmd); } System.Threading.Thread.Sleep(100); Application.DoEvents(); }
原文:https://www.cnblogs.com/zitjubiz/p/14753370.html