internal void Stop(int timeoutMilliseconds)
{
Tracer.Info("Stopping dispatcher thread for session");
Thread localThread = null;
lock (this)
{
localThread = m_thread;
m_thread = null;
if (!m_bStopFlag)
{
m_bStopFlag = true;
//m_event.Set();
m_event.PulseAll();
}
}
if(localThread!=null)
{
localThread.Join(timeoutMilliseconds);
}
Tracer.Info("Dispatcher thread joined");
}