private static void WaitOnEvent(ManualResetEvent e)
{
try
{
e.WaitOne();
}
catch (ObjectDisposedException)
{
// There is a race condition where this event can get disposed
// while we're still in a wait. Not a problem because all we
// care about is the event getting hit
}
}