public void Function() { if (this.InvokeRequired) { this.BeginInvoke(new Action(this.Function)); return; } // controller.DoSomething();
}
其他线程想调用这个函数,这个时候InvokeRequired为1,要做的是new一个新的Function
c#InvokeRequired
最新推荐文章于 2024-02-02 11:03:41 发布
public void Function() { if (this.InvokeRequired) { this.BeginInvoke(new Action(this.Function)); return; } // controller.DoSomething();
}
其他线程想调用这个函数,这个时候InvokeRequired为1,要做的是new一个新的Function