diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-21 00:04:12 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-21 00:13:24 +0200 |
commit | 544575bd09378dcf573e33a315628ecc193925e7 (patch) | |
tree | d5deb8b2e8a21ea9169f18b88dabfdc34363a789 /lib/sqfs/blk_proc/pthread.c | |
parent | 79498fa15227d4659489763ed2a9a1e806c11428 (diff) |
Merge some of serial & pthread block processor code paths/declarations
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/blk_proc/pthread.c')
-rw-r--r-- | lib/sqfs/blk_proc/pthread.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/lib/sqfs/blk_proc/pthread.c b/lib/sqfs/blk_proc/pthread.c index f56dfe1..565bad2 100644 --- a/lib/sqfs/blk_proc/pthread.c +++ b/lib/sqfs/blk_proc/pthread.c @@ -7,46 +7,6 @@ #define SQFS_BUILDING_DLL #include "internal.h" -#include <pthread.h> -#include <string.h> -#include <stdlib.h> - -typedef struct { - sqfs_block_processor_t *shared; - sqfs_compressor_t *cmp; - pthread_t thread; - uint8_t scratch[]; -} compress_worker_t; - -struct sqfs_block_processor_t { - pthread_mutex_t mtx; - pthread_cond_t queue_cond; - pthread_cond_t done_cond; - - /* needs rw access by worker and main thread */ - sqfs_block_t *queue; - sqfs_block_t *queue_last; - - sqfs_block_t *done; - bool terminate; - size_t backlog; - - /* used by main thread only */ - uint32_t enqueue_id; - uint32_t dequeue_id; - - unsigned int num_workers; - sqfs_block_cb cb; - void *user; - int status; - size_t max_backlog; - - /* used only by workers */ - size_t max_block_size; - - compress_worker_t *workers[]; -}; - static void store_completed_block(sqfs_block_processor_t *shared, sqfs_block_t *blk) { @@ -222,30 +182,6 @@ void sqfs_block_processor_destroy(sqfs_block_processor_t *proc) free(proc); } -static int process_completed_blocks(sqfs_block_processor_t *proc, - sqfs_block_t *queue) -{ - sqfs_block_t *it; - int ret; - - while (queue != NULL) { - it = queue; - queue = queue->next; - - if (it->flags & SQFS_BLK_COMPRESS_ERROR) { - proc->status = SQFS_ERROR_COMRPESSOR; - } else { - ret = proc->cb(proc->user, it); - if (ret) - proc->status = ret; - } - - free(it); - } - - return proc->status; -} - int sqfs_block_processor_enqueue(sqfs_block_processor_t *proc, sqfs_block_t *block) { |