两个数据库互锁,用全局变量互锁会偶发软件卡死线程1:调用函数的部分代码 theApp.m_cmux = 1; p->pView->PostMessage(WM_REFRESHSAMPLE, RF_SAMPLE, LPARAM§); while (theApp.m_cmux) { Sleep(20); } theApp.m_cmux = 1; p->pView->PostMessage(WM_REFRESHSAMPLE, RF_SAMPLE, LPARAM§); 其中PostMessage用于发送消息执行数据库写数据,写完数据,最后theApp.m_