我必须同步两个"事件来源"立即(WaitAll)问题是这个"事件来源之一"是监视器。我的快速和肮脏"解决方案是:
AutoResetEvent OuterSyncAutoResetEvent...
const string GetSyncContextLockString...
while(true)
{
lock (GetSyncContextLockString)
{
if (OuterSyncAutoResetEvent.WaitOne(0) == false)
{
break;
}
}
Thread.Sleep(100);
}
还有更多"现代"方式是什么?