- p->no_threads = no_of_threads;
- pthread_mutex_init(&p->mutex, 0);
- pthread_cond_init(&p->input_data, 0);
+ p->mutex = 0;
+ yaz_mutex_create(&p->mutex);
+ yaz_cond_create(&p->input_data);
+ if (p->input_data == 0) /* condition variable could not be created? */
+ {
+ sel_thread_destroy(p);
+ return 0;
+ }