'polls if our child process has completed, without blocking.  this
method has side-effects, such as setting our exit_code, if we happen to
see our child exit while this is running'

def is_alive(self):

    if (self.exit_code is not None):
        return (False, self.exit_code)
    acquired = self._wait_lock.acquire(False)
    if (not acquired):
        if (self.exit_code is not None):
            return (False, self.exit_code)
        return (True, self.exit_code)
    try:
        (pid, exit_code) = no_interrupt(os.waitpid, self.pid, os.WNOHANG)
        if (pid == self.pid):
            self.exit_code = handle_process_exit_code(exit_code)
            self._process_just_ended()
            return (False, self.exit_code)
    except OSError:
        return (False, self.exit_code)
    else:
        return (True, self.exit_code)
    finally:
        self._wait_lock.release()
