Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby21
/
share
/
doc
/
ruby
/
capi
/
html
/
d2
/
d82
/
//opt/alt/ruby21/share/doc/ruby/capi/html/d2/d82/thread__pthread_8h_source.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Ruby: thread_pthread.h Source File</title> <link href="../../tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="../../jquery.js"></script> <script type="text/javascript" src="../../dynsections.js"></script> <link href="../../doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Ruby  <span id="projectnumber">2.1.10p492(2016-04-01revision54464)</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <script type="text/javascript" src="../../menudata.js"></script> <script type="text/javascript" src="../../menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('../../',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">thread_pthread.h</div> </div> </div><!--header--> <div class="contents"> <a href="../../d2/d82/thread__pthread_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/**********************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"></span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> thread_pthread.h -</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"></span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> $Author: ko1 $</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"></span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> Copyright (C) 2004-2007 Koichi Sasada</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">**********************************************************************/</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#ifndef RUBY_THREAD_PTHREAD_H</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#define RUBY_THREAD_PTHREAD_H</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include <pthread.h></span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#ifdef HAVE_PTHREAD_NP_H</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <pthread_np.h></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="../../d2/d82/thread__pthread_8h.html#afc682033096e7c13a63794d984afdb76"> 18</a></span> <span class="keyword">typedef</span> pthread_t <a class="code" href="../../d2/d82/thread__pthread_8h.html#afc682033096e7c13a63794d984afdb76">rb_nativethread_id_t</a>;</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="../../d2/d82/thread__pthread_8h.html#ac57fb299f9395b1de97a46b00a9d12c6"> 19</a></span> <span class="keyword">typedef</span> pthread_mutex_t <a class="code" href="../../d2/d82/thread__pthread_8h.html#ac57fb299f9395b1de97a46b00a9d12c6">rb_nativethread_lock_t</a>;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="../../d0/d6c/structrb__thread__cond__struct.html"> 21</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="../../d0/d6c/structrb__thread__cond__struct.html">rb_thread_cond_struct</a> {</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="../../d0/d6c/structrb__thread__cond__struct.html#aeb24f523a70463c675f1a739038eaf1a"> 22</a></span>  pthread_cond_t <a class="code" href="../../d0/d6c/structrb__thread__cond__struct.html#aeb24f523a70463c675f1a739038eaf1a">cond</a>;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#ifdef HAVE_CLOCKID_T</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <a class="code" href="../../dc/db1/win32_8h.html#a6dcac6a5cea7d9c842145e1444d91e22">clockid_t</a> clockid;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> } <a class="code" href="../../d2/d82/thread__pthread_8h.html#a3613e0afb21e5fe92d2c90b260aef6e8">rb_nativethread_cond_t</a>;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="../../d9/dae/structnative__thread__data__struct.html"> 28</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="../../d9/dae/structnative__thread__data__struct.html">native_thread_data_struct</a> {</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="../../d9/dae/structnative__thread__data__struct.html#a144da313977e6bb9229cb2ae5ec7feb1"> 29</a></span>  <span class="keywordtype">void</span> *<a class="code" href="../../d9/dae/structnative__thread__data__struct.html#a144da313977e6bb9229cb2ae5ec7feb1">signal_thread_list</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="../../d9/dae/structnative__thread__data__struct.html#a510a51dfbb9e208bb3edd9de6f642072"> 30</a></span>  <a class="code" href="../../d0/d6c/structrb__thread__cond__struct.html">rb_nativethread_cond_t</a> <a class="code" href="../../d9/dae/structnative__thread__data__struct.html#a510a51dfbb9e208bb3edd9de6f642072">sleep_cond</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> } <a class="code" href="../../d2/d82/thread__pthread_8h.html#a1730b74045959e1db34dfb31caddc0eb">native_thread_data_t</a>;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <semaphore.h></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#undef except</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#undef try</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#undef leave</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor">#undef finally</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html"> 40</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html">rb_global_vm_lock_struct</a> {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="comment">/* fast path */</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#a615841146b7c9b86aa90bec80144fdd4"> 42</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#a615841146b7c9b86aa90bec80144fdd4">acquired</a>;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#a948be6b7a74025df722091e4da6d9701"> 43</a></span>  pthread_mutex_t <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#a948be6b7a74025df722091e4da6d9701">lock</a>;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="comment">/* slow path */</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#ad29605e99fcf3859e286ef2765f03149"> 46</a></span>  <span class="keyword">volatile</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#ad29605e99fcf3859e286ef2765f03149">waiting</a>;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#a694121592e906091e79c25654d24db4c"> 47</a></span>  <a class="code" href="../../d0/d6c/structrb__thread__cond__struct.html">rb_nativethread_cond_t</a> <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#a694121592e906091e79c25654d24db4c">cond</a>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="comment">/* yield */</span></div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#aa752b2ea5212d90016030b43f7e432f9"> 50</a></span>  <a class="code" href="../../d0/d6c/structrb__thread__cond__struct.html">rb_nativethread_cond_t</a> <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#aa752b2ea5212d90016030b43f7e432f9">switch_cond</a>;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#a18052fb8b8974e1014881d3807c7ffcf"> 51</a></span>  <a class="code" href="../../d0/d6c/structrb__thread__cond__struct.html">rb_nativethread_cond_t</a> <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#a18052fb8b8974e1014881d3807c7ffcf">switch_wait_cond</a>;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#a871bd453d1a5d4321e11a4d0a3983c78"> 52</a></span>  <span class="keywordtype">int</span> <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#a871bd453d1a5d4321e11a4d0a3983c78">need_yield</a>;</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="../../d3/d61/structrb__global__vm__lock__struct.html#ae665ab760ae2fdf50a508074f72a9edb"> 53</a></span>  <span class="keywordtype">int</span> <a class="code" href="../../d3/d61/structrb__global__vm__lock__struct.html#ae665ab760ae2fdf50a508074f72a9edb">wait_yield</a>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> } <a class="code" href="../../d2/d82/thread__pthread_8h.html#af6180b2b92edd0c7033a86693246010b">rb_global_vm_lock_t</a>;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor">#endif </span><span class="comment">/* RUBY_THREAD_PTHREAD_H */</span><span class="preprocessor"></span></div><div class="ttc" id="structnative__thread__data__struct_html_a510a51dfbb9e208bb3edd9de6f642072"><div class="ttname"><a href="../../d9/dae/structnative__thread__data__struct.html#a510a51dfbb9e208bb3edd9de6f642072">native_thread_data_struct::sleep_cond</a></div><div class="ttdeci">rb_nativethread_cond_t sleep_cond</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00030">thread_pthread.h:30</a></div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_ae665ab760ae2fdf50a508074f72a9edb"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#ae665ab760ae2fdf50a508074f72a9edb">rb_global_vm_lock_struct::wait_yield</a></div><div class="ttdeci">int wait_yield</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00053">thread_pthread.h:53</a></div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_ad29605e99fcf3859e286ef2765f03149"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#ad29605e99fcf3859e286ef2765f03149">rb_global_vm_lock_struct::waiting</a></div><div class="ttdeci">volatile unsigned long waiting</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00046">thread_pthread.h:46</a></div></div> <div class="ttc" id="structnative__thread__data__struct_html_a144da313977e6bb9229cb2ae5ec7feb1"><div class="ttname"><a href="../../d9/dae/structnative__thread__data__struct.html#a144da313977e6bb9229cb2ae5ec7feb1">native_thread_data_struct::signal_thread_list</a></div><div class="ttdeci">void * signal_thread_list</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00029">thread_pthread.h:29</a></div></div> <div class="ttc" id="thread__pthread_8h_html_a3613e0afb21e5fe92d2c90b260aef6e8"><div class="ttname"><a href="../../d2/d82/thread__pthread_8h.html#a3613e0afb21e5fe92d2c90b260aef6e8">rb_nativethread_cond_t</a></div><div class="ttdeci">struct rb_thread_cond_struct rb_nativethread_cond_t</div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_aa752b2ea5212d90016030b43f7e432f9"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#aa752b2ea5212d90016030b43f7e432f9">rb_global_vm_lock_struct::switch_cond</a></div><div class="ttdeci">rb_nativethread_cond_t switch_cond</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00050">thread_pthread.h:50</a></div></div> <div class="ttc" id="thread__pthread_8h_html_ac57fb299f9395b1de97a46b00a9d12c6"><div class="ttname"><a href="../../d2/d82/thread__pthread_8h.html#ac57fb299f9395b1de97a46b00a9d12c6">rb_nativethread_lock_t</a></div><div class="ttdeci">pthread_mutex_t rb_nativethread_lock_t</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00019">thread_pthread.h:19</a></div></div> <div class="ttc" id="structnative__thread__data__struct_html"><div class="ttname"><a href="../../d9/dae/structnative__thread__data__struct.html">native_thread_data_struct</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00028">thread_pthread.h:28</a></div></div> <div class="ttc" id="win32_8h_html_a6dcac6a5cea7d9c842145e1444d91e22"><div class="ttname"><a href="../../dc/db1/win32_8h.html#a6dcac6a5cea7d9c842145e1444d91e22">clockid_t</a></div><div class="ttdeci">int clockid_t</div><div class="ttdef"><b>Definition:</b> <a href="../../dc/db1/win32_8h_source.html#l00127">win32.h:127</a></div></div> <div class="ttc" id="thread__pthread_8h_html_a1730b74045959e1db34dfb31caddc0eb"><div class="ttname"><a href="../../d2/d82/thread__pthread_8h.html#a1730b74045959e1db34dfb31caddc0eb">native_thread_data_t</a></div><div class="ttdeci">struct native_thread_data_struct native_thread_data_t</div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_a694121592e906091e79c25654d24db4c"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#a694121592e906091e79c25654d24db4c">rb_global_vm_lock_struct::cond</a></div><div class="ttdeci">rb_nativethread_cond_t cond</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00047">thread_pthread.h:47</a></div></div> <div class="ttc" id="thread__pthread_8h_html_afc682033096e7c13a63794d984afdb76"><div class="ttname"><a href="../../d2/d82/thread__pthread_8h.html#afc682033096e7c13a63794d984afdb76">rb_nativethread_id_t</a></div><div class="ttdeci">pthread_t rb_nativethread_id_t</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00018">thread_pthread.h:18</a></div></div> <div class="ttc" id="structrb__thread__cond__struct_html"><div class="ttname"><a href="../../d0/d6c/structrb__thread__cond__struct.html">rb_thread_cond_struct</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00021">thread_pthread.h:21</a></div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_a18052fb8b8974e1014881d3807c7ffcf"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#a18052fb8b8974e1014881d3807c7ffcf">rb_global_vm_lock_struct::switch_wait_cond</a></div><div class="ttdeci">rb_nativethread_cond_t switch_wait_cond</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00051">thread_pthread.h:51</a></div></div> <div class="ttc" id="structrb__thread__cond__struct_html_aeb24f523a70463c675f1a739038eaf1a"><div class="ttname"><a href="../../d0/d6c/structrb__thread__cond__struct.html#aeb24f523a70463c675f1a739038eaf1a">rb_thread_cond_struct::cond</a></div><div class="ttdeci">pthread_cond_t cond</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00022">thread_pthread.h:22</a></div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_a615841146b7c9b86aa90bec80144fdd4"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#a615841146b7c9b86aa90bec80144fdd4">rb_global_vm_lock_struct::acquired</a></div><div class="ttdeci">unsigned long acquired</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00042">thread_pthread.h:42</a></div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_a871bd453d1a5d4321e11a4d0a3983c78"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#a871bd453d1a5d4321e11a4d0a3983c78">rb_global_vm_lock_struct::need_yield</a></div><div class="ttdeci">int need_yield</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00052">thread_pthread.h:52</a></div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html_a948be6b7a74025df722091e4da6d9701"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html#a948be6b7a74025df722091e4da6d9701">rb_global_vm_lock_struct::lock</a></div><div class="ttdeci">pthread_mutex_t lock</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00043">thread_pthread.h:43</a></div></div> <div class="ttc" id="thread__pthread_8h_html_af6180b2b92edd0c7033a86693246010b"><div class="ttname"><a href="../../d2/d82/thread__pthread_8h.html#af6180b2b92edd0c7033a86693246010b">rb_global_vm_lock_t</a></div><div class="ttdeci">struct rb_global_vm_lock_struct rb_global_vm_lock_t</div></div> <div class="ttc" id="structrb__global__vm__lock__struct_html"><div class="ttname"><a href="../../d3/d61/structrb__global__vm__lock__struct.html">rb_global_vm_lock_struct</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d2/d82/thread__pthread_8h_source.html#l00040">thread_pthread.h:40</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="../../doxygen.png" alt="doxygen"/> </a> 1.8.14 </small></address> </body> </html>