/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/event.c

  • Committer: Suren A. Chilingaryan
  • Date: 2015-10-22 13:57:59 UTC
  • Revision ID: csa@suren.me-20151022135759-nqs5wowy38tvbw09
Documentation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
}
148
148
 
149
149
int pcilib_start(pcilib_t *ctx, pcilib_event_t event_mask, pcilib_event_flags_t flags) {
 
150
    int err;
 
151
    pcilib_register_value_t max_threads;
 
152
 
150
153
    const pcilib_event_api_description_t *api;
151
154
    const pcilib_model_description_t *model_info = pcilib_get_model_description(ctx);
152
155
 
156
159
        return PCILIB_ERROR_NOTSUPPORTED;
157
160
    }
158
161
 
 
162
    err = pcilib_read_register(ctx, "conf", "max_threads", &max_threads);
 
163
    if (!err) {
 
164
        err = pcilib_configure_preprocessing_threads(ctx, max_threads);
 
165
        if (err) pcilib_warning("Error (%i) configuring number of preprocessing threads", err);
 
166
    }
 
167
 
159
168
    if (api->start) 
160
169
        return api->start(ctx->event_ctx, event_mask, flags);
161
170
 
430
439
    pcilib_grab_callback_user_data_t user = {ctx, size, data};
431
440
    
432
441
    err = pcilib_start(ctx, event_mask, PCILIB_EVENT_FLAGS_DEFAULT);
433
 
    if (!err) err = pcilib_trigger(ctx, event_mask, 0, NULL);
 
442
    if (!err) {
 
443
        if (timeout == PCILIB_TIMEOUT_IMMEDIATE) {
 
444
             err = pcilib_trigger(ctx, event_mask, 0, NULL);
 
445
             timeout = PCILIB_EVENT_TIMEOUT;
 
446
        }
 
447
    }
434
448
    if (!err) {
435
449
        err = pcilib_get_next_event(ctx, timeout, &eid, 0, NULL);
436
450
        if (!err) pcilib_grab_callback(event_mask, eid, &user);