private void Wait(int delay) {
Thread.Sleep(delay);
if (_terminated) {
throw new ShotingCancelledException();
}
if (_process.HasExitedSafe()) {
throw new ProcessExitedException();
}
}
}