Можно ли проверить, как на самом деле обрабатывался объект AutoResetEvent
? Он запускается по тайм-ауту или вызовом Set ()из другого метода?
Вот мой код.
private AutoResetEvent autoResetEvent = new AutoResetEvent(false);
private int timeout = 30000;
public void SyncMethod()
{
// some code before
autoResetEvent.WaitOne(timeout);
// if autoResetEvent called by timeout then { do some stuff }
// some code after
}
public void AsyncMethod()
{
// some code before
// ok I am done
autoResetEvent.Set();
}