mirror of
https://github.com/vasi/pixz
synced 2024-10-30 15:21:41 +00:00
commit
8155addb46
@ -388,13 +388,13 @@ void queue_free(queue_t *q) {
|
||||
}
|
||||
|
||||
void queue_push(queue_t *q, int type, void *data) {
|
||||
pthread_mutex_lock(&q->mutex);
|
||||
|
||||
queue_item_t *i = malloc(sizeof(queue_item_t));
|
||||
i->type = type;
|
||||
i->data = data;
|
||||
i->next = NULL;
|
||||
|
||||
pthread_mutex_lock(&q->mutex);
|
||||
|
||||
if (q->last) {
|
||||
q->last->next = i;
|
||||
} else {
|
||||
@ -415,12 +415,12 @@ int queue_pop(queue_t *q, void **datap) {
|
||||
q->first = i->next;
|
||||
if (!q->first)
|
||||
q->last = NULL;
|
||||
pthread_mutex_unlock(&q->mutex);
|
||||
|
||||
*datap = i->data;
|
||||
int type = i->type;
|
||||
free(i);
|
||||
|
||||
pthread_mutex_unlock(&q->mutex);
|
||||
return type;
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ static void read_thread(void) {
|
||||
debug("read: skip %llu", iter.block.number_in_file);
|
||||
continue;
|
||||
}
|
||||
for ( ; w && w->end < uend; w = w->next) ;
|
||||
for ( ; w && w->end <= uend; w = w->next) ;
|
||||
}
|
||||
debug("read: want %llu", iter.block.number_in_file);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user