doEvents()) { usleep(100); } } $xplinstance->detach(); } function signalHandler() { global $running; $running = false; }