主线程中可能有backgroundworker DoWork吗?我的意思是如果某个设备只有一个CPU,有可能发生吗?
PS:我正在研究unity,所以运行Android & IOS & Windows 平台。
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;
}
回首忆惘然
相关分类