def is_inferior_running(inferior):
    """Check if the inferior is a running process

    For the purposes of this check, running does not necessarily mean currently
    executing, but rather that there is a running process on the system for the
    inferior. If this function is being run in the first place then the inferior
    is more than likely stopped by GDB anyway, unless this function were called
    from a background thread.

    """

    for thread in inferior.threads():
        if thread.is_running():
            return True

    return False