protected override void OnClose (TimeSpan timeout)
{
DateTime start = DateTime.Now;
base.OnClose (timeout);
loop = false;
if (!loop_handle.WaitOne (timeout - (DateTime.Now - start)))
throw new TimeoutException ();
if (!finish_handle.WaitOne (timeout - (DateTime.Now - start)))
throw new TimeoutException ();
}