<ahref="thread_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/*</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> * The copyright in this software is being made available under the 2-clauses</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment"> * BSD License, included below. This software may be subject to other third</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> * party and contributor rights, including patent rights, and no such rights</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> * are granted under this license.</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment"> * Copyright (c) 2016, Even Rouault</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment"> * All rights reserved.</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment"> * Redistribution and use in source and binary forms, with or without</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> * modification, are permitted provided that the following conditions</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment"> * are met:</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment"> * 1. Redistributions of source code must retain the above copyright</span></div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment"> * notice, this list of conditions and the following disclaimer.</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> * notice, this list of conditions and the following disclaimer in the</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment"> * documentation and/or other materials provided with the distribution.</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'</span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE</span></div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div><divclass="l
<divclass="ttc"id="group___t_h_r_e_a_d_html_gaf389ecb3a583a30077fc546eef767c89"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#gaf389ecb3a583a30077fc546eef767c89">opj_thread_pool_submit_job</a></div><divclass="ttdeci">OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t *tp, opj_job_fn job_fn, void *user_data)</div><divclass="ttdoc">Submit a new job to be run by one of the thread in the thread pool. </div><divclass="ttdef"><b>Definition:</b> thread.c:827</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga24a3a1b343df1168a3beb57babfa0916"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga24a3a1b343df1168a3beb57babfa0916">opj_thread_pool_create</a></div><divclass="ttdeci">opj_thread_pool_t * opj_thread_pool_create(int num_threads)</div><divclass="ttdoc">Create a new thread pool. </div><divclass="ttdef"><b>Definition:</b> thread.c:625</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga7f8a4c1ce6d9ad2dde1d293fad317522"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga7f8a4c1ce6d9ad2dde1d293fad317522">opj_cond_create</a></div><divclass="ttdeci">opj_cond_t * opj_cond_create(void)</div><divclass="ttdoc">Creates a condition. </div><divclass="ttdef"><b>Definition:</b> thread.c:463</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga6edf64f08cd0b48299800852d52245d6"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga6edf64f08cd0b48299800852d52245d6">opj_cond_wait</a></div><divclass="ttdeci">void opj_cond_wait(opj_cond_t *cond, opj_mutex_t *mutex)</div><divclass="ttdoc">Wait for the condition to be signaled. </div><divclass="ttdef"><b>Definition:</b> thread.c:468</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_gae5f9aa8219645e0e836aaf0c453db624"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#gae5f9aa8219645e0e836aaf0c453db624">opj_thread_fn</a></div><divclass="ttdeci">void(* opj_thread_fn)(void *user_data)</div><divclass="ttdoc">User function to execute in a thread. </div><divclass="ttdef"><b>Definition:</b> thread.h:146</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga38f8cdfd288c8ff8963444403549ad6c"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga38f8cdfd288c8ff8963444403549ad6c">opj_tls_free_func</a></div><divclass="ttdeci">void(* opj_tls_free_func)(void *value)</div><divclass="ttdoc">Type of the function used to free a TLS value. </div><divclass="ttdef"><b>Definition:</b> thread.h:177</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga439cd27c17f11fc56a911a126811fb87"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga439cd27c17f11fc56a911a126811fb87">opj_cond_t</a></div><divclass="ttdeci">struct opj_cond_t opj_cond_t</div><divclass="ttdoc">Opaque type for a condition. </div><divclass="ttdef"><b>Definition:</b> thread.h:81</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_gab1b97098aabc89f98eca8f8f7274f3e7"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#gab1b97098aabc89f98eca8f8f7274f3e7">opj_tls_set</a></div><divclass="ttdeci">OPJ_BOOL opj_tls_set(opj_tls_t *tls, int key, void *value, opj_tls_free_func free_func)</div><divclass="ttdoc">Set a thread local value corresponding to the provided key. </div><divclass="ttdef"><b>Definition:</b> thread.c:540</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga4faef98a6b8495c63e9e5ce9cf0c3fc3"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga4faef98a6b8495c63e9e5ce9cf0c3fc3">opj_thread_pool_get_thread_count</a></div><divclass="ttdeci">int opj_thread_pool_get_thread_count(opj_thread_pool_t *tp)</div><divclass="ttdoc">Return the number of threads associated with the thread pool. </div><divclass="ttdef"><b>Definition:</b> thread.c:914</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga541be683ba651c8244bde3f0d3650c92"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga541be683ba651c8244bde3f0d3650c92">opj_thread_create</a></div><divclass="ttdeci">opj_thread_t * opj_thread_create(opj_thread_fn thread_fn, void *user_data)</div><divclass="ttdoc">Creates a new thread. </div><divclass="ttdef"><b>Definition:</b> thread.c:484</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga66757c34c788b873ad9acfb60a5e008b"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga66757c34c788b873ad9acfb60a5e008b">opj_mutex_destroy</a></div><divclass="ttdeci">void opj_mutex_destroy(opj_mutex_t *mutex)</div><divclass="ttdoc">Destroy a mutex. </div><divclass="ttdef"><b>Definition:</b> thread.c:458</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga0f3687b35d6f3c395e1156a8499d1632"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga0f3687b35d6f3c395e1156a8499d1632">opj_cond_signal</a></div><divclass="ttdeci">void opj_cond_signal(opj_cond_t *cond)</div><divclass="ttdoc">Signal waiting threads on a condition. </div><divclass="ttdef"><b>Definition:</b> thread.c:474</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga0ced26c80598e49bf3a964bb802130f1"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga0ced26c80598e49bf3a964bb802130f1">opj_thread_pool_wait_completion</a></div><divclass="ttdeci">void opj_thread_pool_wait_completion(opj_thread_pool_t *tp, int max_remaining_jobs)</div><divclass="ttdoc">Wait that no more than max_remaining_jobs jobs are remaining in the queue of the thread pool...</div><divclass="ttdef"><b>Definition:</b> thread.c:894</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga29120af1ce48d5ecd651795f2e427755"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga29120af1ce48d5ecd651795f2e427755">opj_mutex_t</a></div><divclass="ttdeci">struct opj_mutex_t opj_mutex_t</div><divclass="ttdoc">Opaque type for a mutex. </div><divclass="ttdef"><b>Definition:</b> thread.h:52</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_gaed72b7b75acb6eaeb620085b01ee365b"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#gaed72b7b75acb6eaeb620085b01ee365b">opj_thread_t</a></div><divclass="ttdeci">struct opj_thread_t opj_thread_t</div><divclass="ttdoc">Opaque type for a thread handle. </div><divclass="ttdef"><b>Definition:</b> thread.h:141</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_ga90caa0ff9c1e54033ef1e3010faf03a9"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#ga90caa0ff9c1e54033ef1e3010faf03a9">opj_tls_get</a></div><divclass="ttdeci">void * opj_tls_get(opj_tls_t *tls, int key)</div><divclass="ttdoc">Get a thread local value corresponding to the provided key. </div><divclass="ttdef"><b>Definition:</b> thread.c:529</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_gad49986b56da75f8609b7c940c17f713f"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#gad49986b56da75f8609b7c940c17f713f">opj_thread_join</a></div><divclass="ttdeci">void opj_thread_join(opj_thread_t *thread)</div><divclass="ttdoc">Wait for a thread to be finished and release associated resources to the thread handle. </div><divclass="ttdef"><b>Definition:</b> thread.c:491</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_gab38a90b92a1d294f7e1886e36a405518"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#gab38a90b92a1d294f7e1886e36a405518">opj_mutex_lock</a></div><divclass="ttdeci">void opj_mutex_lock(opj_mutex_t *mutex)</div><divclass="ttdoc">Lock/acquire the mutex. </div><divclass="ttdef"><b>Definition:</b> thread.c:448</div></div>
<divclass="ttc"id="group___t_h_r_e_a_d_html_gae44e8b9258d0baa19e3671a382faa33e"><divclass="ttname"><ahref="group___t_h_r_e_a_d.html#gae44e8b9258d0baa19e3671a382faa33e">opj_thread_pool_destroy</a></div><divclass="ttdeci">void opj_thread_pool_destroy(opj_thread_pool_t *tp)</div><divclass="ttdoc">Destroy a thread pool. </div><divclass="ttdef"><b>Definition:</b> thread.c:919</div></div>