openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/systemd/1_242+AUTOINC+db2e367bfc-r0/git/src/journal/journal-file.c
static bool journal_file_set_offline_try_restart(JournalFile* f)
{
    for (;;)
    {
        switch (f->offline_state)
        {
            case OFFLINE_AGAIN_FROM_SYNCING:
            case OFFLINE_AGAIN_FROM_OFFLINING:
                return true;

            case OFFLINE_CANCEL:
                if (!__sync_bool_compare_and_swap(&f->offline_state,
                                                  OFFLINE_CANCEL,
                                                  OFFLINE_AGAIN_FROM_SYNCING))
                    continue;
                return true;

            case OFFLINE_SYNCING:
                if (!__sync_bool_compare_and_swap(&f->offline_state,
                                                  OFFLINE_SYNCING,
                                                  OFFLINE_AGAIN_FROM_SYNCING))
                    continue;
                return true;

            case OFFLINE_OFFLINING:
                if (!__sync_bool_compare_and_swap(&f->offline_state,
                                                  OFFLINE_OFFLINING,
                                                  OFFLINE_AGAIN_FROM_OFFLINING))
                    continue;
                return true;

            default:
                return false;
        }
    }
}
/* Trigger a restart if the offline thread is mid-flight in a restartable state.
 */
Trigger a restart if the offline thread is mid-flight in a restartable state.
Trigger a restart if the offline thread is mid - flight in a restartable state .
static bool journal_file_set_offline_try_restart(JournalFile* f)
{
    for (;;)
    {
        switch (f->offline_state)
        {
            case OFFLINE_AGAIN_FROM_SYNCING:
            case OFFLINE_AGAIN_FROM_OFFLINING:
                return true;
            case OFFLINE_CANCEL:
                if (!__sync_bool_compare_and_swap(&f->offline_state,
                                                  OFFLINE_CANCEL,
                                                  OFFLINE_AGAIN_FROM_SYNCING))
                    continue;
                return true;
            case OFFLINE_SYNCING:
                if (!__sync_bool_compare_and_swap(&f->offline_state,
                                                  OFFLINE_SYNCING,
                                                  OFFLINE_AGAIN_FROM_SYNCING))
                    continue;
                return true;
            case OFFLINE_OFFLINING:
                if (!__sync_bool_compare_and_swap(&f->offline_state,
                                                  OFFLINE_OFFLINING,
                                                  OFFLINE_AGAIN_FROM_OFFLINING))
                    continue;
                return true;
            default:
                return false;
        }
    }
}
static bool journal_file_set_offline_try_restart ( JournalFile * f ) { for ( ; ; ) { switch ( f -> offline_state ) { case OFFLINE_AGAIN_FROM_SYNCING : case OFFLINE_AGAIN_FROM_OFFLINING : return true ; case OFFLINE_CANCEL : if ( ! __sync_bool_compare_and_swap ( & f -> offline_state , OFFLINE_CANCEL , OFFLINE_AGAIN_FROM_SYNCING ) ) continue ; return true ; case OFFLINE_SYNCING : if ( ! __sync_bool_compare_and_swap ( & f -> offline_state , OFFLINE_SYNCING , OFFLINE_AGAIN_FROM_SYNCING ) ) continue ; return true ; case OFFLINE_OFFLINING : if ( ! __sync_bool_compare_and_swap ( & f -> offline_state , OFFLINE_OFFLINING , OFFLINE_AGAIN_FROM_OFFLINING ) ) continue ; return true ; default : return false ; } } }
Trigger a restart if the offline thread is mid-flight in a restartable state.
Trigger a restart if the offline thread is mid - flight in a restartable state .