auto
  $   ˆÆÅÄ770Ãa–Ým_J	õ4Ÿº‚ œP ¸&®JbÑ¿Â     ‹      Õ˜QoÚ0Çß÷)<?ìÜÐvÕÚà©#•†ÖRÔ2MÓ4!'vˆEb§¶�ÒO?“Âª²¦bä%¾˜óåÿ»KrÁþÛàº3øÞ¿ ŸW— ÿõÓe·`¡o‡„‚Aà~8jx]ô €‰1ù)B³Ù¬9;lJ5Bƒ”˜,=BÚ(™&5â7~1‡ß ?a„Úø†›”á® ìÈ 91šSf×Í5
S�‘¦!Ò“ÐN–¡TÊÜó‘[g#¡e(?”t^\Áû‹hvÑB	ASaß$`JR>mhd±Ï³Ð*jCÄ#)ŠˆDŒ›#C@RÓ†?º�ëŸÖ™¤X�}Åâ6üØi÷Î®ÛÄ=’1‘ç}®¬Ï9Ä—D�IÊcÎèFç[ç|Ë6œOÀt¤xn¸+Wd×Q#™êœXÖcK�¨u/çB_Ê‰~KFÿüæ¢7º7.%´±R÷rm îÅ„W,2RÍ—â]¤w"ÔùYy
–Ò%b àYÏWðLÄXÈ™XG²ézf'³Z‡2Ž5³žÎ¬K¢µuÐzßð¼Fëð¼ÓÖ í÷å_¡b™R¦Ö™6(¤Ü– 8VÑ~¼“Óãã�Úw\�ˆä$ä)7sˆWö¾á ”M!¶‡:Jç:"ŠòtªžXcÍî0…QC6µ©×»±2€·g C¢ç"*1ÜYm«1Ìeš3Í¢ÇÂ¬MÕëÞ#fqJ³†	§”	ˆÝ¸/ ÕÛx²ðÔ¶•—Ö6vÜÎ¹ˆSwáÒª_!¸0l¤ìW*(J{_ŠQ�#»³ ö°�¶±[å¹œ1eÅ»±ºþƒ=Ñ7afõ»±†_åËvP×V X&§Å�E(Í:bH«_ÖP¸æ6õzµáñßÅWvuJ¦¬èÂKc_Þû¯I¿!ö¢Åq¯Î§mWieïË+´:‡Q$*Z€kxMm vã6
ðç©â'Znýúh±�ì#·Qý‹Fž    7   	ˆl–Ým_J	õ4Ÿº‚ œP ¸&®JbÑ¿‘äÇò 8à\v17…#¿ÏÁƒh¹Æ¿Ã      	auto
     ˆÈÇÆ508Å¿Ã ü    ‹      ½”]kÛ0†ïû+4]ìÎ>qšlÐÊYXX¾H3Æ#È’b‹Ù–‘ÔdÍ¯Ÿg4I÷AlK�^é9²E^$óáêÓb„Þ­¦´øðv2" |¼$«¤íè…�`4ÃçÎÕ7 »Ý.Ü]‡Úd°ZBîÊ¢ÖÅ](œÀôŠ4mô
‘\2áïˆ8å
IÇ•�ß�Þ Ð÷Î*!{poØœ	Bs(Tšjm] ˜“�S¥ŒÂ×½@È-øF ÍñÉpŒ&©ÍŒÑ3¤û�ÃbYz˜¤y4”¸mY¡²*ÆN×˜UfÈcP\WÒ‚U_ÃLm0b…‹ñçñpþÅsàòf4%åFnbüfÏnçq‚éŒ•’ ;ÏL=3ÀtÂ¬C¥j£¤¸ßµð�Ú_LZ&‘–U;¥«G¼â©*×…­™wí{ƒÜœR-"~WÆ*Æb°ÍVÉxÙ–D4�«û‡½Âtá©Ê¡DÉ�6G›6úe•ÚúöÇ+:®Õ¨,w˜" ³ä_r]ÖFZ+Å©¦/áYÁåh�LGá^WrmkÉ×Ün×UÈ0ÛcúTï©Õ/ÝN·Dþê¢(ºéöº ú¢½ÿ¿¾Í~­›ýZ7R�Sè�²»žÃ´¾zÂô?p8þúÇ
�ö û.â"-+    6   ˆl–Ým_J	õ4Ÿº‚ œP ¸®	å1hß�þB gŽ¹-´à›þÂƒh¹ÇÀÄ      auto
      ˆ¿‘äÇò 8à\v18 ‰°?Âƒh¹ÇÀÄ      disabled
  ?   ˆl–äY>”TÜZÔ%+‚~ã`S�ÿ�þ_�+6WÅ(_‘òÆð?ŸÃƒagÈ_ˆI|¥�+y,ÂÆ 	Ñ    /* Copyright (c) the JPEG XL Project Authors. All rights reserved.
 *
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file.
 */

/** @addtogroup libjxl_threads
 * @{
 * @file thread_parallel_runner.h
 * @brief implementation using std::thread of a ::JxlParallelRunner.
 */

/** Implementation of JxlParallelRunner than can be used to enable
 * multithreading when using the JPEG XL library. This uses std::thread
 * internally and related synchronization functions. The number of threads
 * created is fixed at construction time and the threads are re-used for every
 * ThreadParallelRunner::Runner call. Only one concurrent
 * JxlThreadParallelRunner call per instance is allowed at a time.
 *
 * This is a scalable, lower-overhead thread pool runner, especially suitable
 * for data-parallel computations in the fork-join model, where clients need to
 * know when all tasks have completed.
 *
 * This thread pool can efficiently load-balance millions of tasks using an
 * atomic counter, thus avoiding per-task virtual or system calls. With 48
 * hyperthreads and 1M tasks that add to an atomic counter, overall runtime is
 * 10-20x higher when using std::async, and ~200x for a queue-based thread
 */

#ifndef JXL_THREAD_PARALLEL_RUNNER_H_
#define JXL_THREAD_PARALLEL_RUNNER_H_

#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#include "jxl/jxl_threads_export.h"
#include "jxl/memory_manager.h"
#include "jxl/parallel_runner.h"

#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif

/** Parallel runner internally using std::thread. Use as JxlParallelRunner.
 */
JXL_THREADS_EXPORT JxlParallelRetCode JxlThreadParallelRunner(
    void* runner_opaque, void* jpegxl_opaque, JxlParallelRunInit init,
    JxlParallelRunFunction func, uint32_t start_range, uint32_t end_range);

/** Creates the runner for JxlThreadParallelRunner. Use as the opaque
 * runner.
 */
JXL_THREADS_EXPORT void* JxlThreadParallelRunnerCreate(
    const JxlMemoryManager* memory_manager, size_t num_worker_threads);

/** Destroys the runner created by JxlThreadParallelRunnerCreate.
 */
JXL_THREADS_EXPORT void JxlThreadParallelRunnerDestroy(void* runner_opaque);

/** Returns a default num_worker_threads value for
 * JxlThreadParallelRunnerCreate.
 */
JXL_THREADS_EXPORT size_t JxlThreadParallelRunnerDefaultNumWorkerThreads();

#if defined(__cplusplus) || def