Lines Matching full:threads
67 /// thread back to the stack of free threads.
92 /// Next structure in the stack of free worker threads.
166 worker_thread *threads; member
168 /// Number of structures in "threads" above. This is also the
169 /// number of threads that will be created at maximum.
173 /// thus the number of worker threads actually created so far.
176 /// Stack of free threads. When a thread finishes, it puts itself
177 /// back into this stack. This starts as empty because threads
400 // where the main thread is waiting for the threads to stop. in worker_start()
423 // Return this thread to the stack of free threads. in worker_start()
443 /// Make the threads stop but not exit. Optionally wait for them to stop.
447 // Tell the threads to stop. in threads_stop()
449 mythread_sync(coder->threads[i].mutex) { in threads_stop()
450 coder->threads[i].state = THR_STOP; in threads_stop()
451 mythread_cond_signal(&coder->threads[i].cond); in threads_stop()
458 // Wait for the threads to settle in the idle state. in threads_stop()
460 mythread_sync(coder->threads[i].mutex) { in threads_stop()
461 while (coder->threads[i].state != THR_IDLE) in threads_stop()
462 mythread_cond_wait(&coder->threads[i].cond, in threads_stop()
463 &coder->threads[i].mutex); in threads_stop()
471 /// Stop the threads and free the resources associated with them.
472 /// Wait until the threads have exited.
477 mythread_sync(coder->threads[i].mutex) { in threads_end()
478 coder->threads[i].state = THR_EXIT; in threads_end()
479 mythread_cond_signal(&coder->threads[i].cond); in threads_end()
484 int ret = mythread_join(coder->threads[i].thread_id); in threads_end()
489 lzma_free(coder->threads, allocator); in threads_end()
499 worker_thread *thr = &coder->threads[coder->threads_initialized]; in initialize_new_thread()
841 // All Blocks have been encoded and the threads have stopped. in stream_encode_mt()
898 // Threads must be killed before the output queue can be freed. in stream_encoder_mt_end()
966 if (options->flags != 0 || options->threads == 0 in get_options()
967 || options->threads > LZMA_THREADS_MAX) in get_options()
1010 // Lock coder->mutex to prevent finishing threads from moving their in get_progress()
1017 mythread_sync(coder->threads[i].mutex) { in get_progress()
1018 *progress_in += coder->threads[i].progress_in; in get_progress()
1019 *progress_out += coder->threads[i] in get_progress()
1100 coder->threads = NULL; in stream_encoder_mt_init()
1113 assert(options->threads > 0); in stream_encoder_mt_init()
1114 if (coder->threads_max != options->threads) { in stream_encoder_mt_init()
1117 coder->threads = NULL; in stream_encoder_mt_init()
1123 coder->threads = lzma_alloc( in stream_encoder_mt_init()
1124 options->threads * sizeof(worker_thread), in stream_encoder_mt_init()
1126 if (coder->threads == NULL) in stream_encoder_mt_init()
1129 coder->threads_max = options->threads; in stream_encoder_mt_init()
1131 // Reuse the old structures and threads. Tell the running in stream_encoder_mt_init()
1132 // threads to stop and wait until they have stopped. in stream_encoder_mt_init()
1138 options->threads)); in stream_encoder_mt_init()
1246 const uint64_t inbuf_memusage = options->threads * block_size; in lzma_stream_encoder_mt_memusage()
1253 filters_memusage *= options->threads; in lzma_stream_encoder_mt_memusage()
1257 outbuf_size_max, options->threads); in lzma_stream_encoder_mt_memusage()
1264 + options->threads * sizeof(worker_thread); in lzma_stream_encoder_mt_memusage()