Mur*_*sli 0 c# multithreading synchronization wait
我有下面的代码(但不起作用)..我需要等到线程完成其工作然后执行然后下一个命令
private void btnPaste_Click(object sender, EventArgs e)
{
if (copiedItems != null)
{
if (copy)
{
System.Threading.Thread thPASTE = new System.Threading.Thread(PasteFromCopy);
thPASTE.Start(currAddress);
lock (this)
{
btnRefresh_Click(sender, e);
}
}
else
{
System.Threading.Thread thPASTE = new System.Threading.Thread(PasteFromMove);
thPASTE.Start(currAddress);
lock (this)
{
btnRefresh_Click(sender, e);
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
粘贴应该做一些代码,然后我应该刷新列表即时显示..我需要这样做,因为它不适用于我,当我调用线程中的刷新
我怎么办?