aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor/winpthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/block_processor/winpthread.c')
-rw-r--r--lib/sqfs/block_processor/winpthread.c43
1 files changed, 6 insertions, 37 deletions
diff --git a/lib/sqfs/block_processor/winpthread.c b/lib/sqfs/block_processor/winpthread.c
index afd66c1..e39f795 100644
--- a/lib/sqfs/block_processor/winpthread.c
+++ b/lib/sqfs/block_processor/winpthread.c
@@ -363,6 +363,11 @@ static int append_to_work_queue(sqfs_block_processor_t *proc,
return status;
}
+static int block_processor_sync(sqfs_block_processor_t *proc)
+{
+ return append_to_work_queue(proc, NULL);
+}
+
static thread_pool_processor_t *block_processor_create(size_t max_block_size,
sqfs_compressor_t *cmp,
unsigned int num_workers,
@@ -386,6 +391,7 @@ static thread_pool_processor_t *block_processor_create(size_t max_block_size,
return NULL;
}
+ proc->base.sync = block_processor_sync;
proc->base.append_to_work_queue = append_to_work_queue;
proc->num_workers = num_workers;
proc->max_backlog = max_backlog;
@@ -411,43 +417,6 @@ fail:
return NULL;
}
-int sqfs_block_processor_sync(sqfs_block_processor_t *proc)
-{
- return append_to_work_queue(proc, NULL);
-}
-
-int sqfs_block_processor_finish(sqfs_block_processor_t *proc)
-{
- thread_pool_processor_t *thproc = (thread_pool_processor_t *)proc;
- sqfs_block_t *blk;
- int status;
-
- status = sqfs_block_processor_sync(proc);
-
- if (status == 0 && proc->frag_block != NULL) {
- blk = proc->frag_block;
- blk->next = NULL;
- proc->frag_block = NULL;
-
- status = proc->process_block(blk, proc->cmp,
- thproc->workers[0]->scratch,
- proc->max_block_size);
-
- if (status == 0)
- status = handle_io_queue(thproc, blk);
-
- if (status != 0) {
- LOCK(&thproc->mtx);
- if (thproc->status == 0)
- thproc->status = status;
- SIGNAL_ALL(&thproc->queue_cond);
- UNLOCK(&thproc->mtx);
- }
- }
-
- return status;
-}
-
#if defined(_WIN32) || defined(__WINDOWS__)
sqfs_block_processor_t *sqfs_block_processor_create(size_t max_block_size,
sqfs_compressor_t *cmp,