从概念上讲,我想完成以下任务,但在理解如何在 C# 中正确编码时遇到了麻烦:
SomeMethod { // Member of AClass{}
DoSomething;
Start WorkerMethod() from BClass in another thread;
DoSomethingElse;
}
然后,当 WorkerMethod() 完成时,运行:
void SomeOtherMethod() // Also member of AClass{}
{ ... }
任何人都可以举个例子吗?