后台线程DoWork是否在主线程中? 我的意思是,如果某些设备只有一个CPU,那有可能发生吗?
PS:我正在团结一致,所以请运行Android&IOS&Windows Platform。
System.ComponentModel.BackgroundWorker bw = new System.ComponentModel.BackgroundWorker();
bool inMainThread = false;
int mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
bw.DoWork += (object sender, System.ComponentModel.DoWorkEventArgs e) =>
{ // Is it possible equal true ??
inMainThread = mainThreadId == System.Threading.Thread.CurrentThread.ManagedThreadId;
}