XZ Utils 5.3.5beta
Data Fields
worker_thread Struct Reference

Data Fields

worker_state state
 Worker state is protected with our mutex. More...
 
uint8_t * in
 Input buffer that will contain the whole Block except Block Header. More...
 
size_t in_size
 Amount of memory allocated for "in". More...
 
size_t in_filled
 Number of bytes written to "in" by the main thread. More...
 
size_t in_pos
 Number of bytes consumed from "in" by the worker thread. More...
 
size_t out_pos
 
struct lzma_stream_codercoder
 
const lzma_allocatorallocator
 
lzma_outbufoutbuf
 Output queue buffer to which the uncompressed data is written. More...
 
size_t progress_in
 
size_t progress_out
 Like progress_in but for uncompressed data. More...
 
partial_update_mode partial_update
 
lzma_next_coder block_decoder
 Block decoder. More...
 
lzma_block block_options
 
uint64_t mem_filters
 Filter chain memory usage. More...
 
struct worker_threadnext
 Next structure in the stack of free worker threads. More...
 
mythread_mutex mutex
 
mythread_cond cond
 
mythread thread_id
 

Field Documentation

◆ state

worker_state worker_thread::state

Worker state is protected with our mutex.

Referenced by threads_stop().

◆ in

uint8_t* worker_thread::in

Input buffer that will contain the whole Block except Block Header.

◆ in_size

size_t worker_thread::in_size

Amount of memory allocated for "in".

Referenced by worker_stop().

◆ in_filled

size_t worker_thread::in_filled

Number of bytes written to "in" by the main thread.

◆ in_pos

size_t worker_thread::in_pos

Number of bytes consumed from "in" by the worker thread.

◆ out_pos

size_t worker_thread::out_pos

Amount of uncompressed data that has been decoded. This local copy is needed because updating outbuf->pos requires locking the main mutex (coder->mutex).

◆ coder

struct lzma_stream_coder* worker_thread::coder

Pointer to the main structure is needed to (1) lock the main mutex (coder->mutex) when updating outbuf->pos and (2) when putting this thread back to the stack of free threads.

Referenced by comp_blk_size(), and worker_stop().

◆ allocator

const lzma_allocator* worker_thread::allocator

The allocator is set by the main thread. Since a copy of the pointer is kept here, the application must not change the allocator before calling lzma_end().

◆ outbuf

lzma_outbuf* worker_thread::outbuf

Output queue buffer to which the uncompressed data is written.

◆ progress_in

size_t worker_thread::progress_in

Amount of compressed data that has already been decompressed. This is updated from in_pos when our mutex is locked. This is size_t, not uint64_t, because per-thread progress is limited to sizes of allocated buffers.

◆ progress_out

size_t worker_thread::progress_out

Like progress_in but for uncompressed data.

◆ partial_update

partial_update_mode worker_thread::partial_update

Updating outbuf->pos requires locking the main mutex (coder->mutex). Since the main thread will only read output from the oldest outbuf in the queue, only the worker thread that is associated with the oldest outbuf needs to update its outbuf->pos. This avoids useless mutex contention that would happen if all worker threads were frequently locking the main mutex to update their outbuf->pos.

Only when partial_update is something else than PARTIAL_DISABLED, this worker thread will update outbuf->pos after each call to the Block decoder.

Referenced by worker_enable_partial_update().

◆ block_decoder

lzma_next_coder worker_thread::block_decoder

Block decoder.

◆ block_options

lzma_block worker_thread::block_options

Thread-specific Block options are needed because the Block decoder modifies the struct given to it at initialization.

◆ mem_filters

uint64_t worker_thread::mem_filters

Filter chain memory usage.

Referenced by worker_stop().

◆ next

struct worker_thread* worker_thread::next

Next structure in the stack of free worker threads.

Referenced by worker_stop().

◆ thread_id

mythread worker_thread::thread_id

The ID of this thread is used to join the thread when it's not needed anymore.


The documentation for this struct was generated from the following file: