产生原因:除主线程外有调用到,同时调用会导致死锁
解决方案:
1.public void OutputLogMessage(string logMessage)
{
lock (this)
Invoke(new MethodInvoker(delegate ()
{
XXXXXX;
}));
}
2.
public void OutputLogMessage(string logMessage)
{
Control.CheckForIllegalCrossThreadCalls = false;
XXXXXx
}