Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
while (!outtask->finished) {
pthread_cond_wait(&c->finished_task_cond, &c->finished_task_mutex);
}
+ pthread_mutex_unlock(&c->finished_task_mutex);
/* We now own outtask completely: No worker thread touches it any more,
* because there is no outstanding task with this index. */
outtask->finished = 0;
if(pkt->data)
*got_packet_ptr = 1;
c->finished_task_index = (c->finished_task_index + 1) % c->max_tasks;
- pthread_mutex_unlock(&c->finished_task_mutex);
return outtask->return_code;
}