考虑以下方法
public void DoSomething()
{
Thread initialThread = Thread.CurrentThread;
//Do something
Thread endingThread = Thread.CurrentThread;
Debug.Assert(object.ReferenceEquals(initialThread, endingThread));
}
假设代码已编译并且不是迭代器,断言是否总是在 C# 中传递?