示例#1
0
文件: workers.c 项目: Agobin/chapel
void API_FUNC qthread_enable_worker(const qthread_worker_id_t w)
{                      /*{{{ */
    assert(qthread_library_initialized);

    unsigned int shep   = w % qlib->nshepherds;
    unsigned int worker = w / qlib->nshepherds;

    assert(shep < qlib->nshepherds);

    if (worker == 0) { qthread_enable_shepherd(shep); }
    qthread_debug(SHEPHERD_CALLS, "began on shep(%i)\n", shep);
    if (worker < qlib->nworkerspershep) {
        qthread_internal_incr(&(qlib->nworkers_active), &(qlib->nworkers_active_lock), 1);
        (void)QT_CAS(qlib->shepherds[shep].workers[worker].active, 0, 1);
    }
}                      /*}}} */
示例#2
0
GLT_func_prefix void glt_thread_enable(GLT_thread id) {
    CHECK(qthread_enable_shepherd(id),0);
}