blob: 319b15101ff4d9c944639770f740bc9f59da1065 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.13-->
<!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.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Apache Log4cxx: threadutility.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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '42']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</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">Apache Log4cxx
&#160;<span id="projectnumber">Version 1.2.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('threadutility_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">threadutility.h</div></div>
</div><!--header-->
<div class="contents">
<a href="threadutility_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> * this work for additional information regarding copyright ownership.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance with</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"> * the License. You may obtain a copy of the License at</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment"> *</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment"> *</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"> * limitations under the License.</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> */</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#ifndef _LOG4CXX_THREADUTILITY_H</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#define _LOG4CXX_THREADUTILITY_H</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include &lt;thread&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include &quot;<a class="code" href="logstring_8h.html">log4cxx/logstring.h</a>&quot;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include &quot;<a class="code" href="widelife_8h.html">widelife.h</a>&quot;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span>LOG4CXX_NS</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span>{</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">namespace </span>helpers</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span>{</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="namespacelog4cxx_1_1helpers.html#a9ce3a9949c6c3a658ba595315403cc96"> 38</a></span><span class="keyword">typedef</span> std::function&lt;void()&gt; <a class="code hl_typedef" href="namespacelog4cxx_1_1helpers.html#a9ce3a9949c6c3a658ba595315403cc96">ThreadStartPre</a>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="keyword">typedef</span> std::function&lt;void( <a class="code hl_typedef" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> threadName,</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> std::thread::id threadId,</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="namespacelog4cxx_1_1helpers.html#a97fabbcd266481fd111bab2694c262e7"> 51</a></span> std::thread::native_handle_type nativeHandle )&gt; <a class="code hl_typedef" href="namespacelog4cxx_1_1helpers.html#a97fabbcd266481fd111bab2694c262e7">ThreadStarted</a>;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="namespacelog4cxx_1_1helpers.html#a1d71ce798777ebf6da590d70c39d8c45"> 57</a></span><span class="keyword">typedef</span> std::function&lt;void()&gt; <a class="code hl_typedef" href="namespacelog4cxx_1_1helpers.html#a1d71ce798777ebf6da590d70c39d8c45">ThreadStartPost</a>;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4"> 59</a></span><span class="keyword">enum class</span> <a class="code hl_enumeration" href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4">ThreadConfigurationType</a></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span>{</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <a class="code hl_enumvalue" href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4ac47cb7f1b141da17f1bd43d288bbb0df">NoConfiguration</a>,</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <a class="code hl_enumvalue" href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4af1de03e4530e983a87f6cfa89774ebe1">BlockSignalsOnly</a>,</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <a class="code hl_enumvalue" href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4ae63069f8afeeedaa2919a4528094bcaf">NameThreadOnly</a>,</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <a class="code hl_enumvalue" href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4ace3cf34390ba5c8471c51d27d58a8456">BlockSignalsAndNameThread</a>,</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span>};</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="keyword">class </span>ThreadUtility;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="namespacelog4cxx_1_1helpers.html#adc5b91e6d6ee497b7712591970f5dd86"> 68</a></span><a class="code hl_function" href="namespacelog4cxx.html#ac860424200b65dc9449d08dc539068b2">LOG4CXX_PTR_DEF</a>(<a class="code hl_class" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html">ThreadUtility</a>);</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#ad069b1b73d4a701f63f3409ee3a366b9"> 70</a></span><span class="keyword">class </span>LOG4CXX_EXPORT <a class="code hl_class" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html">ThreadUtility</a></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>{</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keyword">friend</span> <span class="keyword">class </span>LOG4CXX_NS::helpers::WideLife&lt;<a class="code hl_class" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html">ThreadUtility</a>&gt;;</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <a class="code hl_class" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html">ThreadUtility</a>();</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> LOG4CXX_NS::helpers::ThreadStartPre preStartFunction();</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> LOG4CXX_NS::helpers::ThreadStarted threadStartedFunction();</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> LOG4CXX_NS::helpers::ThreadStartPost postStartFunction();</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(priv_data, m_priv)</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a4b701f02f1cf4725dd0112201313dab5"> 82</a></span> <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a4b701f02f1cf4725dd0112201313dab5">~ThreadUtility</a>();</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a6b07fb65e79953abdccf7a2753831653"> 84</a></span> <span class="keyword">static</span> <a class="code hl_class" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html">ThreadUtility</a>* <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a6b07fb65e79953abdccf7a2753831653">instance</a>();</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#ad8d5f94e39e37447de00e3affee69dc0"> 90</a></span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#ad8d5f94e39e37447de00e3affee69dc0">configure</a>( <a class="code hl_enumeration" href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4">ThreadConfigurationType</a> type );</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a30d776e789c7f38f8fc1342919b944b3"> 97</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a30d776e789c7f38f8fc1342919b944b3">configureFuncs</a>( <a class="code hl_typedef" href="namespacelog4cxx_1_1helpers.html#a9ce3a9949c6c3a658ba595315403cc96">ThreadStartPre</a> pre_start,</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_typedef" href="namespacelog4cxx_1_1helpers.html#a97fabbcd266481fd111bab2694c262e7">ThreadStarted</a> started,</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_typedef" href="namespacelog4cxx_1_1helpers.html#a1d71ce798777ebf6da590d70c39d8c45">ThreadStartPost</a> post_start );</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a37816cd5db434a40b35fdba4ba70d2a9"> 106</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a37816cd5db434a40b35fdba4ba70d2a9">preThreadBlockSignals</a>();</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a4f697885ff06d3e448d964fe7c69a264"> 112</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a4f697885ff06d3e448d964fe7c69a264">threadStartedNameThread</a>(<a class="code hl_typedef" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> threadName,</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> std::thread::id thread_id,</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> std::thread::native_handle_type native_handle);</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#ad20d6771fe5dab3d69419e558ca7be98"> 121</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#ad20d6771fe5dab3d69419e558ca7be98">postThreadUnblockSignals</a>();</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keyword">template</span>&lt;<span class="keyword">class </span>Function, <span class="keyword">class</span>... Args&gt;</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#aa163c0bb49c77d97d781558c10a3d8c4"> 127</a></span> std::thread <a class="code hl_function" href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#aa163c0bb49c77d97d781558c10a3d8c4">createThread</a>(<a class="code hl_typedef" href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">LogString</a> name,</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> Function&amp;&amp; f,</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> Args&amp;&amp; ... args)</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> {</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> LOG4CXX_NS::helpers::ThreadStartPre pre_start = preStartFunction();</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> LOG4CXX_NS::helpers::ThreadStarted thread_start = threadStartedFunction();</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> LOG4CXX_NS::helpers::ThreadStartPost post_start = postStartFunction();</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">if</span> ( pre_start )</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> {</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> pre_start();</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> std::thread t( f, args... );</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> </div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">if</span> ( thread_start )</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> {</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> thread_start( name,</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> t.get_id(),</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> t.native_handle() );</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> }</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keywordflow">if</span> ( post_start )</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> post_start();</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> }</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span> t;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span>};</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span>} <span class="comment">/* namespace helpers */</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span>} <span class="comment">/* namespace log4cxx */</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html">log4cxx::helpers::ThreadUtility</a></div><div class="ttdef"><b>Definition:</b> threadutility.h:71</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_a30d776e789c7f38f8fc1342919b944b3"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a30d776e789c7f38f8fc1342919b944b3">log4cxx::helpers::ThreadUtility::configureFuncs</a></div><div class="ttdeci">void configureFuncs(ThreadStartPre pre_start, ThreadStarted started, ThreadStartPost post_start)</div><div class="ttdoc">Configure the thread functions that log4cxx will use.</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_a37816cd5db434a40b35fdba4ba70d2a9"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a37816cd5db434a40b35fdba4ba70d2a9">log4cxx::helpers::ThreadUtility::preThreadBlockSignals</a></div><div class="ttdeci">void preThreadBlockSignals()</div><div class="ttdoc">A pre-start thread function that blocks signals to the new thread (if the system has pthreads).</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_a4b701f02f1cf4725dd0112201313dab5"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a4b701f02f1cf4725dd0112201313dab5">log4cxx::helpers::ThreadUtility::~ThreadUtility</a></div><div class="ttdeci">~ThreadUtility()</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_a4f697885ff06d3e448d964fe7c69a264"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a4f697885ff06d3e448d964fe7c69a264">log4cxx::helpers::ThreadUtility::threadStartedNameThread</a></div><div class="ttdeci">void threadStartedNameThread(LogString threadName, std::thread::id thread_id, std::thread::native_handle_type native_handle)</div><div class="ttdoc">A thread_started function that names the thread using the appropriate system call.</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_a6b07fb65e79953abdccf7a2753831653"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#a6b07fb65e79953abdccf7a2753831653">log4cxx::helpers::ThreadUtility::instance</a></div><div class="ttdeci">static ThreadUtility * instance()</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_aa163c0bb49c77d97d781558c10a3d8c4"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#aa163c0bb49c77d97d781558c10a3d8c4">log4cxx::helpers::ThreadUtility::createThread</a></div><div class="ttdeci">std::thread createThread(LogString name, Function &amp;&amp;f, Args &amp;&amp;... args)</div><div class="ttdoc">Start a thread.</div><div class="ttdef"><b>Definition:</b> threadutility.h:127</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_ad20d6771fe5dab3d69419e558ca7be98"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#ad20d6771fe5dab3d69419e558ca7be98">log4cxx::helpers::ThreadUtility::postThreadUnblockSignals</a></div><div class="ttdeci">void postThreadUnblockSignals()</div><div class="ttdoc">A post-start thread function that unblocks signals that preThreadBlockSignals blocked before starting...</div></div>
<div class="ttc" id="aclasslog4cxx_1_1helpers_1_1ThreadUtility_html_ad8d5f94e39e37447de00e3affee69dc0"><div class="ttname"><a href="classlog4cxx_1_1helpers_1_1ThreadUtility.html#ad8d5f94e39e37447de00e3affee69dc0">log4cxx::helpers::ThreadUtility::configure</a></div><div class="ttdeci">static void configure(ThreadConfigurationType type)</div><div class="ttdoc">Utility method for configuring the ThreadUtility in a standard configuration.</div></div>
<div class="ttc" id="alogstring_8h_html"><div class="ttname"><a href="logstring_8h.html">logstring.h</a></div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a1d71ce798777ebf6da590d70c39d8c45"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a1d71ce798777ebf6da590d70c39d8c45">log4cxx::helpers::ThreadStartPost</a></div><div class="ttdeci">std::function&lt; void()&gt; ThreadStartPost</div><div class="ttdoc">Called after a thread has started.</div><div class="ttdef"><b>Definition:</b> threadutility.h:57</div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a84bb84c01710854af8519e70d8a548d4"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4">log4cxx::helpers::ThreadConfigurationType</a></div><div class="ttdeci">ThreadConfigurationType</div><div class="ttdef"><b>Definition:</b> threadutility.h:60</div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a84bb84c01710854af8519e70d8a548d4ac47cb7f1b141da17f1bd43d288bbb0df"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4ac47cb7f1b141da17f1bd43d288bbb0df">log4cxx::helpers::ThreadConfigurationType::NoConfiguration</a></div><div class="ttdeci">@ NoConfiguration</div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a84bb84c01710854af8519e70d8a548d4ace3cf34390ba5c8471c51d27d58a8456"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4ace3cf34390ba5c8471c51d27d58a8456">log4cxx::helpers::ThreadConfigurationType::BlockSignalsAndNameThread</a></div><div class="ttdeci">@ BlockSignalsAndNameThread</div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a84bb84c01710854af8519e70d8a548d4ae63069f8afeeedaa2919a4528094bcaf"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4ae63069f8afeeedaa2919a4528094bcaf">log4cxx::helpers::ThreadConfigurationType::NameThreadOnly</a></div><div class="ttdeci">@ NameThreadOnly</div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a84bb84c01710854af8519e70d8a548d4af1de03e4530e983a87f6cfa89774ebe1"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a84bb84c01710854af8519e70d8a548d4af1de03e4530e983a87f6cfa89774ebe1">log4cxx::helpers::ThreadConfigurationType::BlockSignalsOnly</a></div><div class="ttdeci">@ BlockSignalsOnly</div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a97fabbcd266481fd111bab2694c262e7"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a97fabbcd266481fd111bab2694c262e7">log4cxx::helpers::ThreadStarted</a></div><div class="ttdeci">std::function&lt; void(LogString threadName, std::thread::id threadId, std::thread::native_handle_type nativeHandle)&gt; ThreadStarted</div><div class="ttdoc">Called when a new thread has started.</div><div class="ttdef"><b>Definition:</b> threadutility.h:51</div></div>
<div class="ttc" id="anamespacelog4cxx_1_1helpers_html_a9ce3a9949c6c3a658ba595315403cc96"><div class="ttname"><a href="namespacelog4cxx_1_1helpers.html#a9ce3a9949c6c3a658ba595315403cc96">log4cxx::helpers::ThreadStartPre</a></div><div class="ttdeci">std::function&lt; void()&gt; ThreadStartPre</div><div class="ttdoc">A function that will be called before a thread is started.</div><div class="ttdef"><b>Definition:</b> threadutility.h:38</div></div>
<div class="ttc" id="anamespacelog4cxx_html_aa2308ed05fef2a1366066cb38b177e94"><div class="ttname"><a href="namespacelog4cxx.html#aa2308ed05fef2a1366066cb38b177e94">log4cxx::LogString</a></div><div class="ttdeci">std::basic_string&lt; logchar &gt; LogString</div><div class="ttdef"><b>Definition:</b> logstring.h:60</div></div>
<div class="ttc" id="anamespacelog4cxx_html_ac860424200b65dc9449d08dc539068b2"><div class="ttname"><a href="namespacelog4cxx.html#ac860424200b65dc9449d08dc539068b2">log4cxx::LOG4CXX_PTR_DEF</a></div><div class="ttdeci">LOG4CXX_PTR_DEF(Appender)</div></div>
<div class="ttc" id="awidelife_8h_html"><div class="ttname"><a href="widelife_8h.html">widelife.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_8f91b758b065bd819ee8f7dc3f677aaf.html">src</a></li><li class="navelem"><a class="el" href="dir_1b5b2ce64a57900ce45e762cd4aeb527.html">main</a></li><li class="navelem"><a class="el" href="dir_ab306221cab606ae77d28622ae23b6e8.html">include</a></li><li class="navelem"><a class="el" href="dir_d6ab321c53270d8e494d88f6a7352018.html">log4cxx</a></li><li class="navelem"><a class="el" href="dir_85c0a9502ea6452e43783ddabef03b11.html">helpers</a></li><li class="navelem"><a class="el" href="threadutility_8h.html">threadutility.h</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="https://www.doxygen.nl/images/doxygen.png" alt="Doxygen"/></a> 1.9.6 on Thu Jan 25 2024 </li>
<li class="center">
Copyright &copy; 2003-2023 <a href="https://www.apache.org/">Apache Software Foundation</a>. All Rights Reserved. <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy Policy</a><br/>
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, and the Apache Logging project logo are trademarks of The Apache Software Foundation.<br/>
</li>
</ul>
</div>
</body>
</html>