Exemple #1
0
static aligned_t barrier_thread(void *arg)
{
    void **args = (void**)arg;
    qt_barrier_t *b   = (qt_barrier_t *)args[0];
    uintptr_t     id = (uintptr_t)args[1];
    aligned_t     idx = qthread_incr(&initme_idx, 1);
    qthread_shepherd_id_t shep;
    qthread_worker_id_t wkr;

    wkr = qthread_worker(&shep);
    //iprintf("I woke up on shep %u worker %u, barrier %p, using ID number %u, idx %u\n", shep, wkr, b, id, idx);
    qthread_incr(&(initme[idx]), 1);
    qt_barrier_enter(b, id);
    return 0;
}
Exemple #2
0
void API_FUNC qt_barrier_enter(qt_barrier_t *b)
{                                      /*{{{ */
    qt_barrier_enter_id(b, qthread_worker(NULL));
}                                      /*}}} */