static void *rcu_read_stress_test(void *arg)

{

    int i;

    int itercnt = 0;

    struct rcu_stress *p;

    int pc;

    long long n_reads_local = 0;

    volatile int garbage = 0;



    rcu_register_thread();



    *(struct rcu_reader_data **)arg = &rcu_reader;

    while (goflag == GOFLAG_INIT) {

        g_usleep(1000);

    }

    while (goflag == GOFLAG_RUN) {

        rcu_read_lock();

        p = atomic_rcu_read(&rcu_stress_current);

        if (p->mbtest == 0) {

            n_mberror++;

        }

        rcu_read_lock();

        for (i = 0; i < 100; i++) {

            garbage++;

        }

        rcu_read_unlock();

        pc = p->pipe_count;

        rcu_read_unlock();

        if ((pc > RCU_STRESS_PIPE_LEN) || (pc < 0)) {

            pc = RCU_STRESS_PIPE_LEN;

        }

        atomic_inc(&rcu_stress_count[pc]);

        n_reads_local++;

        if ((++itercnt % 0x1000) == 0) {

            synchronize_rcu();

        }

    }

    atomic_add(&n_reads, n_reads_local);



    rcu_unregister_thread();

    return NULL;

}

static void *rcu_read_stress_test(void *arg)

{

    int i;

    int itercnt = 0;

    struct rcu_stress *p;

    int pc;

    long long n_reads_local = 0;

    volatile int garbage = 0;



    rcu_register_thread();



    *(struct rcu_reader_data **)arg = &rcu_reader;

    while (goflag == GOFLAG_INIT) {

        g_usleep(1000);

    }

    while (goflag == GOFLAG_RUN) {

        rcu_read_lock();

        p = atomic_rcu_read(&rcu_stress_current);

        if (p->mbtest == 0) {

            n_mberror++;

        }

        rcu_read_lock();

        for (i = 0; i < 100; i++) {

            garbage++;

        }

        rcu_read_unlock();

        pc = p->pipe_count;

        rcu_read_unlock();

        if ((pc > RCU_STRESS_PIPE_LEN) || (pc < 0)) {

            pc = RCU_STRESS_PIPE_LEN;

        }

        atomic_inc(&rcu_stress_count[pc]);

        n_reads_local++;

        if ((++itercnt % 0x1000) == 0) {

            synchronize_rcu();

        }

    }

    atomic_add(&n_reads, n_reads_local);



    rcu_unregister_thread();

    return NULL;

}

static void *FUNC_0(void *VAR_0)

{

    int VAR_1;

    int VAR_2 = 0;

    struct rcu_stress *VAR_3;

    int VAR_4;

    long long VAR_5 = 0;

    volatile int VAR_6 = 0;



    rcu_register_thread();



    *(struct rcu_reader_data **)VAR_0 = &rcu_reader;

    while (goflag == GOFLAG_INIT) {

        g_usleep(1000);

    }

    while (goflag == GOFLAG_RUN) {

        rcu_read_lock();

        VAR_3 = atomic_rcu_read(&rcu_stress_current);

        if (VAR_3->mbtest == 0) {

            n_mberror++;

        }

        rcu_read_lock();

        for (VAR_1 = 0; VAR_1 < 100; VAR_1++) {

            VAR_6++;

        }

        rcu_read_unlock();

        VAR_4 = VAR_3->pipe_count;

        rcu_read_unlock();

        if ((VAR_4 > RCU_STRESS_PIPE_LEN) || (VAR_4 < 0)) {

            VAR_4 = RCU_STRESS_PIPE_LEN;

        }

        atomic_inc(&rcu_stress_count[VAR_4]);

        VAR_5++;

        if ((++VAR_2 % 0x1000) == 0) {

            synchronize_rcu();

        }

    }

    atomic_add(&n_reads, VAR_5);



    rcu_unregister_thread();

    return NULL;

}

static void *FUNC_0(void *VAR_0)
{ int VAR_1; int VAR_2 = 0; struct rcu_stress *VAR_3; int VAR_4; long long VAR_5 = 0; volatile int VAR_6 = 0; rcu_register_thread(); *(struct rcu_reader_data **)VAR_0 = &rcu_reader; while (goflag == GOFLAG_INIT) { g_usleep(1000); } while (goflag == GOFLAG_RUN) { rcu_read_lock(); VAR_3 = atomic_rcu_read(&rcu_stress_current); if (VAR_3->mbtest == 0) { n_mberror++; } rcu_read_lock(); for (VAR_1 = 0; VAR_1 < 100; VAR_1++) { VAR_6++; } rcu_read_unlock(); VAR_4 = VAR_3->pipe_count; rcu_read_unlock(); if ((VAR_4 > RCU_STRESS_PIPE_LEN) || (VAR_4 < 0)) { VAR_4 = RCU_STRESS_PIPE_LEN; } atomic_inc(&rcu_stress_count[VAR_4]); VAR_5++; if ((++VAR_2 % 0x1000) == 0) { synchronize_rcu(); } } atomic_add(&n_reads, VAR_5); rcu_unregister_thread(); return NULL; }