void ThisSemaphoreWaitOrParentThreadStopped()
{
while (true)
{
// If the parent thread have been stopped. We should not wait any longer.
if (Kill || !ParentThread.IsAlive)
{
break;
}
if (ThisEvent.WaitOne(20))
{
// Signaled.
break;
}
}
if (Kill || !ParentThread.IsAlive)
{
//throw(new StopException());
Thread.CurrentThread.Abort();
//throw (new StopException());
}
}