public void Stop()
{
try
{
m_Stop = true;
if(m_JournalScanner_Thread != null)
{
do
{
// wait until thread is not running anymore
Thread.Sleep(25);
} while ((m_JournalScanner_Thread.ThreadState & (System.Threading.ThreadState.Stopped | System.Threading.ThreadState.Unstarted)) == 0);
m_FileWatcher.Dispose();
m_FileWatcher = null;
m_JournalScanner_Thread = null;
}
}
catch (Exception ex)
{
throw new Exception("Error while stopping the journal scanner", ex);
}
}