线程加锁解锁,用于循环条件不确定大小

CustomControl.StepPanel panel2 = (CustomControl.StepPanel)flowLayoutPanel2.Controls[job.StepIdx-job.IndexBack-j];
mre1.Reset();
BeginInvoke(new Action(() =>
{
panel2.FunCompleted(job.StepList[job.StepIdx - j].StepValue);
mre1.Set();
}));
mre1.Wait();

快乐而轻松的写代码
原文地址:https://www.cnblogs.com/libei/p/5832113.html