private void MyThreadFunc()
{
Tracer.Info("Dispatcher thread started");
while (true) // loop forever (well, at least until we've been asked to stop)
{
lock (this)
{
if (m_bStopFlag)
break;
}
try
{
m_dispatchFunc();
}
catch (Exception ex)
{
if (m_exceptionListener != null)
m_exceptionListener(ex);
}
//m_event.WaitOne();
m_event.Wait();
}
Tracer.Info("Dispatcher thread stopped");
}