diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-16 17:34:06 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-16 17:34:06 +0100 |
commit | 1c82a9f2fa98e68b68e6868298fba1830d91d1db (patch) | |
tree | 10d0943535cf2c52ac808234b810200d69202172 /lib/sqfs/block_processor/internal.h | |
parent | cab741413084e1f6b2bd9288273c7b14dfd4a8d7 (diff) |
block processor: move the internals to the respective implementations
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor/internal.h')
-rw-r--r-- | lib/sqfs/block_processor/internal.h | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/lib/sqfs/block_processor/internal.h b/lib/sqfs/block_processor/internal.h index b7fbef0..3c6570e 100644 --- a/lib/sqfs/block_processor/internal.h +++ b/lib/sqfs/block_processor/internal.h @@ -22,17 +22,6 @@ #include <string.h> #include <stdlib.h> -#include <zlib.h> - -#ifdef WITH_PTHREAD -#include <pthread.h> -#include <signal.h> -#elif defined(_WIN32) || defined(__WINDOWS__) -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - -typedef struct compress_worker_t compress_worker_t; typedef struct sqfs_block_t { struct sqfs_block_t *next; @@ -52,53 +41,18 @@ typedef struct sqfs_block_t { struct sqfs_block_processor_t { sqfs_object_t obj; - /* synchronization primitives */ -#ifdef WITH_PTHREAD - pthread_mutex_t mtx; - pthread_cond_t queue_cond; - pthread_cond_t done_cond; -#elif defined(_WIN32) || defined(__WINDOWS__) - CRITICAL_SECTION mtx; - CONDITION_VARIABLE queue_cond; - CONDITION_VARIABLE done_cond; -#endif - - /* needs rw access by worker and main thread */ - sqfs_block_t *queue; - sqfs_block_t *queue_last; - - sqfs_block_t *done; - size_t backlog; - int status; - - /* used by main thread only */ - sqfs_u32 enqueue_id; - sqfs_u32 dequeue_id; - - unsigned int num_workers; - size_t max_backlog; - sqfs_frag_table_t *frag_tbl; sqfs_compressor_t *cmp; - sqfs_block_t *frag_block; - sqfs_block_writer_t *wr; + sqfs_block_processor_stats_t stats; - /* file API */ sqfs_inode_generic_t *inode; sqfs_block_t *blk_current; sqfs_u32 blk_flags; - /* used only by workers */ size_t max_block_size; - -#if defined(WITH_PTHREAD) || defined(_WIN32) || defined(__WINDOWS__) - compress_worker_t *workers[]; -#else - sqfs_u8 scratch[]; -#endif }; SQFS_INTERNAL int process_completed_block(sqfs_block_processor_t *proc, |