public virtual void Join()
{
lock (this)
{
if (debug)
{
Console.Out.WriteLine(name + " Join");
}
while (_thread == null)
{
try
{
System.Threading.Monitor.Wait(this);
}
catch (System.Threading.ThreadInterruptedException)
{
}
}
while (_running)
{
try
{
System.Threading.Monitor.Wait(this);
}
catch (System.Threading.ThreadInterruptedException)
{
}
}
_thread = null;
}
}