Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > by-pkgid > 4f5f2dc0f55b453456458df885792b0b > files > 530

ucommon-doc-5.0.4-1mdv2010.2.i586.rpm

<!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"/>
<title>ucommon: ucommon/thread.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<h1>ucommon/thread.h</h1><a href="a00202.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2006-2010 David Sugar, Tycho Softworks.</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// This file is part of GNU uCommon C++.</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">// GNU uCommon C++ is free software: you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">// it under the terms of the GNU Lesser General Public License as published</span>
<a name="l00007"></a>00007 <span class="comment">// by the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">// (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">//</span>
<a name="l00010"></a>00010 <span class="comment">// GNU uCommon C++ is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">// GNU Lesser General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 <span class="comment">// You should have received a copy of the GNU Lesser General Public License</span>
<a name="l00016"></a>00016 <span class="comment">// along with GNU uCommon C++.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00017"></a>00017 
<a name="l00053"></a>00053 <span class="preprocessor">#ifndef _UCOMMON_THREAD_H_</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define _UCOMMON_THREAD_H_</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a>00056 <span class="preprocessor">#ifndef _UCOMMON_CONFIG_H_</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#include &lt;<a class="code" href="a00194.html" title="Various miscellaneous platform specific headers and defines.">ucommon/platform.h</a>&gt;</span>
<a name="l00058"></a>00058 <span class="preprocessor">#endif</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a>00060 <span class="preprocessor">#ifndef _UCOMMON_ACCESS_H_</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#include &lt;<a class="code" href="a00177.html" title="Locking classes for member function automatic operations.">ucommon/access.h</a>&gt;</span>
<a name="l00062"></a>00062 <span class="preprocessor">#endif</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span>
<a name="l00064"></a>00064 <span class="preprocessor">#ifndef _UCOMMON_TIMERS_H_</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#include &lt;<a class="code" href="a00203.html" title="Realtime timers and timer queues.">ucommon/timers.h</a>&gt;</span>
<a name="l00066"></a>00066 <span class="preprocessor">#endif</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span>
<a name="l00068"></a>00068 <span class="preprocessor">#ifndef _UCOMMON_MEMORY_H_</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#include &lt;<a class="code" href="a00190.html" title="Private heaps, pools, and associations.">ucommon/memory.h</a>&gt;</span>
<a name="l00070"></a>00070 <span class="preprocessor">#endif</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span>
<a name="l00072"></a>00072 NAMESPACE_UCOMMON
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 <span class="keyword">class </span>SharedPointer;
<a name="l00075"></a>00075 
<a name="l00086"></a><a class="code" href="a00036.html">00086</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l00087"></a>00087 {
<a name="l00088"></a>00088 <span class="keyword">private</span>:
<a name="l00089"></a>00089     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>;
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 <span class="preprocessor">#if defined(_MSCONDITIONAL_)</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span>    CRITICAL_SECTION mutex;
<a name="l00093"></a>00093     CONDITION_VARIABLE cond;
<a name="l00094"></a>00094 <span class="preprocessor">#elif defined(_MSWINDOWS_)</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>    <span class="keyword">enum</span> {SIGNAL = 0, BROADCAST = 1};
<a name="l00096"></a>00096     HANDLE events[2];
<a name="l00097"></a>00097     <span class="keywordtype">unsigned</span> waiting;
<a name="l00098"></a>00098     CRITICAL_SECTION mlock;
<a name="l00099"></a>00099     CRITICAL_SECTION mutex;
<a name="l00100"></a>00100 <span class="preprocessor">#else</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#ifndef __PTH__</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span>    <span class="keyword">class </span>__LOCAL attribute
<a name="l00103"></a>00103     {
<a name="l00104"></a>00104     <span class="keyword">public</span>:
<a name="l00105"></a>00105         pthread_condattr_t attr;
<a name="l00106"></a>00106         attribute();
<a name="l00107"></a>00107     };
<a name="l00108"></a>00108 
<a name="l00109"></a>00109     __LOCAL <span class="keyword">static</span> attribute attr;
<a name="l00110"></a>00110 <span class="preprocessor">#endif</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span>
<a name="l00112"></a>00112     pthread_cond_t cond;
<a name="l00113"></a>00113     pthread_mutex_t mutex;
<a name="l00114"></a>00114 <span class="preprocessor">#endif</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span>
<a name="l00116"></a>00116 <span class="keyword">protected</span>:
<a name="l00117"></a>00117     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>;
<a name="l00118"></a>00118 
<a name="l00124"></a>00124     <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00125"></a>00125 
<a name="l00131"></a>00131     <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<span class="keyword">struct</span> timespec *timeout);
<a name="l00132"></a>00132 
<a name="l00133"></a>00133 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00135"></a>00135         {EnterCriticalSection(&amp;mutex);};
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a06fc306b76334e4410e554d683ae790b" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00138"></a>00138         {LeaveCriticalSection(&amp;mutex);};
<a name="l00139"></a>00139 
<a name="l00140"></a>00140     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<span class="keywordtype">void</span>);
<a name="l00141"></a>00141     <span class="keywordtype">void</span> signal(<span class="keywordtype">void</span>);
<a name="l00142"></a>00142     <span class="keywordtype">void</span> broadcast(<span class="keywordtype">void</span>);
<a name="l00143"></a>00143 
<a name="l00144"></a>00144 <span class="preprocessor">#else</span>
<a name="l00145"></a>00145 <span class="preprocessor"></span>
<a name="l00148"></a><a class="code" href="a00036.html#aa56be71c5eb39203a07ed50e2ea28e17">00148</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00149"></a>00149         {pthread_mutex_lock(&amp;mutex);};
<a name="l00150"></a>00150 
<a name="l00154"></a><a class="code" href="a00036.html#a7172831c0cb9b490017157f37ab9ca6c">00154</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a06fc306b76334e4410e554d683ae790b" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00155"></a>00155         {pthread_mutex_unlock(&amp;mutex);};
<a name="l00156"></a>00156 
<a name="l00160"></a><a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4">00160</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<span class="keywordtype">void</span>)
<a name="l00161"></a>00161         {pthread_cond_wait(&amp;cond, &amp;mutex);};
<a name="l00162"></a>00162 
<a name="l00166"></a><a class="code" href="a00036.html#af3f181206c9da93092cb7efd66f3b401">00166</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> signal(<span class="keywordtype">void</span>)
<a name="l00167"></a>00167         {pthread_cond_signal(&amp;cond);};
<a name="l00168"></a>00168 
<a name="l00172"></a><a class="code" href="a00036.html#ababd9cfbaefcb76bbc878c8d84d70629">00172</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcast(<span class="keywordtype">void</span>)
<a name="l00173"></a>00173         {pthread_cond_broadcast(&amp;cond);};
<a name="l00174"></a>00174 <span class="preprocessor">#endif</span>
<a name="l00175"></a>00175 <span class="preprocessor"></span>
<a name="l00179"></a>00179     <a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>();
<a name="l00180"></a>00180 
<a name="l00184"></a>00184     ~<a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>();
<a name="l00185"></a>00185 
<a name="l00186"></a>00186 <span class="keyword">public</span>:
<a name="l00187"></a>00187 <span class="preprocessor">#if !defined(_MSWINDOWS_) &amp;&amp; !defined(__PTH__)</span>
<a name="l00188"></a>00188 <span class="preprocessor"></span>
<a name="l00193"></a><a class="code" href="a00036.html#ac9ac29dd41a11b01d4f113216dd8fa7e">00193</a>     <span class="keyword">static</span> <span class="keyword">inline</span> pthread_condattr_t *initializer(<span class="keywordtype">void</span>)
<a name="l00194"></a>00194         {<span class="keywordflow">return</span> &amp;attr.attr;};
<a name="l00195"></a>00195 <span class="preprocessor">#endif</span>
<a name="l00196"></a>00196 <span class="preprocessor"></span>
<a name="l00203"></a>00203     <span class="keyword">static</span> <span class="keywordtype">void</span> gettimeout(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout, <span class="keyword">struct</span> timespec *hires);
<a name="l00204"></a>00204 };
<a name="l00205"></a>00205 
<a name="l00213"></a><a class="code" href="a00037.html">00213</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a> : <span class="keyword">private</span> <a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l00214"></a>00214 {
<a name="l00215"></a>00215 <span class="keyword">protected</span>:
<a name="l00216"></a>00216 <span class="preprocessor">#if defined _MSCONDITIONAL_</span>
<a name="l00217"></a>00217 <span class="preprocessor"></span>    CONDITION_VARIABLE bcast;
<a name="l00218"></a>00218 <span class="preprocessor">#elif !defined(_MSWINDOWS_)</span>
<a name="l00219"></a>00219 <span class="preprocessor"></span>    pthread_cond_t bcast;
<a name="l00220"></a>00220 <span class="preprocessor">#endif</span>
<a name="l00221"></a>00221 <span class="preprocessor"></span>
<a name="l00222"></a>00222     <span class="keywordtype">unsigned</span> pending, waiting, sharing;
<a name="l00223"></a>00223 
<a name="l00229"></a>00229     <span class="keywordtype">bool</span> waitSignal(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00230"></a>00230 
<a name="l00236"></a>00236     <span class="keywordtype">bool</span> waitBroadcast(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00237"></a>00237 
<a name="l00238"></a>00238 
<a name="l00244"></a>00244     <span class="keywordtype">bool</span> waitSignal(<span class="keyword">struct</span> timespec *timeout);
<a name="l00245"></a>00245 
<a name="l00251"></a>00251     <span class="keywordtype">bool</span> waitBroadcast(<span class="keyword">struct</span> timespec *timeout);
<a name="l00252"></a>00252 
<a name="l00259"></a><a class="code" href="a00037.html#af41903213fb4b76183f6c4fb5d39479b">00259</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#a8de2cf280ade43c8dbe686efe584acac" title="Convert a millisecond timeout into use for high resolution conditional timers.">gettimeout</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout, <span class="keyword">struct</span> timespec *hires)
<a name="l00260"></a>00260         {Conditional::gettimeout(timeout, hires);};
<a name="l00261"></a>00261 
<a name="l00262"></a>00262 
<a name="l00263"></a>00263 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l00264"></a>00264 <span class="preprocessor"></span>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#aa56be71c5eb39203a07ed50e2ea28e17" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00265"></a>00265         {EnterCriticalSection(&amp;mutex);};
<a name="l00266"></a>00266 
<a name="l00267"></a>00267     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#a7172831c0cb9b490017157f37ab9ca6c" title="Unlock the conditional&amp;#39;s supporting mutex.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00268"></a>00268         {LeaveCriticalSection(&amp;mutex);};
<a name="l00269"></a>00269 
<a name="l00270"></a>00270     <span class="keywordtype">void</span> waitSignal(<span class="keywordtype">void</span>);
<a name="l00271"></a>00271     <span class="keywordtype">void</span> waitBroadcast(<span class="keywordtype">void</span>);
<a name="l00272"></a>00272 
<a name="l00273"></a>00273     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#af3f181206c9da93092cb7efd66f3b401" title="Signal the conditional to release one waiting thread.">signal</a>(<span class="keywordtype">void</span>)
<a name="l00274"></a>00274         {Conditional::signal();};
<a name="l00275"></a>00275 
<a name="l00276"></a>00276     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#ababd9cfbaefcb76bbc878c8d84d70629" title="Signal the conditional to release all waiting threads.">broadcast</a>(<span class="keywordtype">void</span>)
<a name="l00277"></a>00277         {Conditional::broadcast();};
<a name="l00278"></a>00278 
<a name="l00279"></a>00279 <span class="preprocessor">#else</span>
<a name="l00280"></a>00280 <span class="preprocessor"></span>
<a name="l00283"></a><a class="code" href="a00037.html#adfed02c5900b0eba056ce95ae00a63ad">00283</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#aa56be71c5eb39203a07ed50e2ea28e17" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00284"></a>00284         {pthread_mutex_lock(&amp;mutex);};
<a name="l00285"></a>00285 
<a name="l00289"></a><a class="code" href="a00037.html#a53860c540120dff8e491c514e0348bc2">00289</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#a7172831c0cb9b490017157f37ab9ca6c" title="Unlock the conditional&amp;#39;s supporting mutex.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00290"></a>00290         {pthread_mutex_unlock(&amp;mutex);};
<a name="l00291"></a>00291 
<a name="l00295"></a><a class="code" href="a00037.html#aea9459d1c4e5202408bcfdce6c32be58">00295</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> waitSignal(<span class="keywordtype">void</span>)
<a name="l00296"></a>00296         {pthread_cond_wait(&amp;cond, &amp;mutex);};
<a name="l00297"></a>00297 
<a name="l00301"></a><a class="code" href="a00037.html#a8c400a2a8e57215243f83b1749470340">00301</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> waitBroadcast(<span class="keywordtype">void</span>)
<a name="l00302"></a>00302         {pthread_cond_wait(&amp;bcast, &amp;mutex);};
<a name="l00303"></a>00303 
<a name="l00304"></a>00304 
<a name="l00308"></a><a class="code" href="a00037.html#afa69355fefea6af4beb31173ef110d92">00308</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#af3f181206c9da93092cb7efd66f3b401" title="Signal the conditional to release one waiting thread.">signal</a>(<span class="keywordtype">void</span>)
<a name="l00309"></a>00309         {pthread_cond_signal(&amp;cond);};
<a name="l00310"></a>00310 
<a name="l00314"></a><a class="code" href="a00037.html#a2c1e895ec0ffda95e341a4b7fec06266">00314</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#ababd9cfbaefcb76bbc878c8d84d70629" title="Signal the conditional to release all waiting threads.">broadcast</a>(<span class="keywordtype">void</span>)
<a name="l00315"></a>00315         {pthread_cond_broadcast(&amp;bcast);};
<a name="l00316"></a>00316 <span class="preprocessor">#endif</span>
<a name="l00317"></a>00317 <span class="preprocessor"></span><span class="keyword">public</span>:
<a name="l00321"></a>00321     <a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>();
<a name="l00322"></a>00322 
<a name="l00326"></a>00326     ~<a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>();
<a name="l00327"></a>00327 
<a name="l00331"></a>00331     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5422fe5f7269f2606c8317e29e4147bf" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<span class="keywordtype">void</span>);
<a name="l00332"></a>00332 
<a name="l00336"></a>00336     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a7bbf6bb584edfaa7d0cf79c1312ea26f" title="Convenience function to exclusively schedule conditional access.">modify</a>(<span class="keywordtype">void</span>);
<a name="l00337"></a>00337 
<a name="l00341"></a>00341     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00342"></a>00342 
<a name="l00346"></a>00346     <span class="keywordtype">void</span> <a class="code" href="a00208.html#af77af9c36e881ef569e2fb1bf5dca1d6" title="Convenience function to commit an exclusive access lock.">commit</a>(<span class="keywordtype">void</span>);
<a name="l00347"></a>00347 
<a name="l00354"></a>00354     <span class="keywordtype">void</span> limit_sharing(<span class="keywordtype">unsigned</span> <a class="code" href="a00208.html#a76c25a471c75550616662fab96eea86b" title="Convenience function to return max of two objects.">max</a>);
<a name="l00355"></a>00355 };
<a name="l00356"></a>00356 
<a name="l00365"></a><a class="code" href="a00161.html">00365</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a> : <span class="keyword">public</span> <a class="code" href="a00162.html" title="Timer class to use when scheduling realtime events.">Timer</a>
<a name="l00366"></a>00366 {
<a name="l00367"></a>00367 <span class="keyword">private</span>:
<a name="l00368"></a>00368 <span class="preprocessor">#ifdef _MSWINDOWS_</span>
<a name="l00369"></a>00369 <span class="preprocessor"></span>    HANDLE event;
<a name="l00370"></a>00370 <span class="preprocessor">#else</span>
<a name="l00371"></a>00371 <span class="preprocessor"></span>    pthread_cond_t cond;
<a name="l00372"></a>00372     <span class="keywordtype">bool</span> signalled;
<a name="l00373"></a>00373 <span class="preprocessor">#endif</span>
<a name="l00374"></a>00374 <span class="preprocessor"></span>    pthread_mutex_t mutex;
<a name="l00375"></a>00375 
<a name="l00376"></a>00376 <span class="keyword">protected</span>:
<a name="l00381"></a>00381     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>);
<a name="l00382"></a>00382 
<a name="l00387"></a>00387     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00388"></a>00388 
<a name="l00396"></a>00396     <span class="keywordtype">bool</span> <a class="code" href="a00162.html#afcf74a86209ba1cf91f3afbe7ffc7ebe" title="Sleep current thread until the specified timer expires.">sync</a>(<span class="keywordtype">void</span>);
<a name="l00397"></a>00397 
<a name="l00398"></a>00398 <span class="keyword">public</span>:
<a name="l00402"></a>00402     <a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>(<span class="keywordtype">void</span>);
<a name="l00403"></a>00403 
<a name="l00408"></a>00408     <a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00409"></a>00409 
<a name="l00414"></a>00414     <a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>(time_t timeout);
<a name="l00415"></a>00415 
<a name="l00419"></a>00419     ~<a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>();
<a name="l00420"></a>00420 
<a name="l00426"></a>00426     <span class="keywordtype">void</span> signal(<span class="keywordtype">void</span>);
<a name="l00427"></a>00427 
<a name="l00434"></a>00434     <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00435"></a>00435 
<a name="l00439"></a>00439     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<span class="keywordtype">void</span>);
<a name="l00440"></a>00440 
<a name="l00444"></a>00444     <span class="keywordtype">void</span> <a class="code" href="a00162.html#a5e502da0e1068fbfe79527b6da4efa68" title="A value to use when resetting.">reset</a>(<span class="keywordtype">void</span>);
<a name="l00445"></a>00445 
<a name="l00450"></a><a class="code" href="a00161.html#a216b48cf3b744b14ad93640c17870cbd">00450</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> signal(<a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>&amp; timed)
<a name="l00451"></a>00451         {timed.<a class="code" href="a00161.html#a76d9fc78d5837b3442a8644af7f82957" title="Signal pending event.">signal</a>();};
<a name="l00452"></a>00452 
<a name="l00457"></a><a class="code" href="a00161.html#ace2fc944cf0bdd2fa0302c40ca22aeca">00457</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00162.html#a5e502da0e1068fbfe79527b6da4efa68" title="A value to use when resetting.">reset</a>(<a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>&amp; timed)
<a name="l00458"></a>00458         {timed.<a class="code" href="a00161.html#a1eb9948289077588c63393f36e039a1c" title="Reset triggered conditional.">reset</a>();};
<a name="l00459"></a>00459 
<a name="l00466"></a><a class="code" href="a00161.html#a34ace00ce72ea3b56a017f154d1865d5">00466</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>&amp; timed, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l00467"></a>00467         {<span class="keywordflow">return</span> timed.<a class="code" href="a00161.html#a7e3a308a10177488b16b0082ba840e1d" title="Wait to be signalled or until timer expires.">wait</a>(timeout);};
<a name="l00468"></a>00468 };
<a name="l00469"></a>00469 
<a name="l00477"></a><a class="code" href="a00114.html">00477</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00114.html" title="Portable recursive exclusive lock.">RecursiveMutex</a> : <span class="keyword">private</span> <a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>, <span class="keyword">public</span> <a class="code" href="a00049.html" title="An exclusive locking protocol interface base.">ExclusiveProtocol</a>
<a name="l00478"></a>00478 {
<a name="l00479"></a>00479 <span class="keyword">protected</span>:
<a name="l00480"></a>00480     <span class="keywordtype">unsigned</span> waiting;
<a name="l00481"></a>00481     <span class="keywordtype">unsigned</span> lockers;
<a name="l00482"></a>00482     pthread_t locker;
<a name="l00483"></a>00483 
<a name="l00484"></a>00484     <span class="keywordtype">void</span> <a class="code" href="a00049.html#ad1cf530ebd33ec7045fa13c2cd59b4b2" title="Protocol interface to exclusive lock the object.">Exlock</a>(<span class="keywordtype">void</span>);
<a name="l00485"></a>00485     <span class="keywordtype">void</span> <a class="code" href="a00049.html#a16b87d186954541ad0ef2e6fc8e04070" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l00486"></a>00486 
<a name="l00487"></a>00487 <span class="keyword">public</span>:
<a name="l00491"></a>00491     <a class="code" href="a00114.html" title="Portable recursive exclusive lock.">RecursiveMutex</a>();
<a name="l00492"></a>00492 
<a name="l00496"></a>00496     <span class="keywordtype">void</span> <a class="code" href="a00036.html#aa56be71c5eb39203a07ed50e2ea28e17" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<span class="keywordtype">void</span>);
<a name="l00497"></a>00497 
<a name="l00501"></a>00501     <span class="keywordtype">bool</span> <a class="code" href="a00036.html#aa56be71c5eb39203a07ed50e2ea28e17" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00502"></a>00502 
<a name="l00506"></a>00506     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00507"></a>00507 
<a name="l00512"></a>00512     <span class="keywordtype">unsigned</span> getLocking(<span class="keywordtype">void</span>);
<a name="l00513"></a>00513 
<a name="l00518"></a>00518     <span class="keywordtype">unsigned</span> getWaiting(<span class="keywordtype">void</span>);
<a name="l00519"></a>00519 
<a name="l00524"></a><a class="code" href="a00114.html#a33bde5ad340d5882f67c613a4859fefc">00524</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#aa56be71c5eb39203a07ed50e2ea28e17" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<a class="code" href="a00114.html" title="Portable recursive exclusive lock.">RecursiveMutex</a>&amp; rex)
<a name="l00525"></a>00525         {rex.<a class="code" href="a00114.html#ad5b50251914d7eaeb73f0075ec466d41" title="Acquire or increase locking.">lock</a>();};
<a name="l00526"></a>00526 
<a name="l00531"></a><a class="code" href="a00114.html#ab4f94eb56dfac570acc28bb12d1f0b02">00531</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00114.html" title="Portable recursive exclusive lock.">RecursiveMutex</a>&amp; rex)
<a name="l00532"></a>00532         {rex.<a class="code" href="a00114.html#aa56322f581c331e7f15049a0a9ecf3e9" title="Release or decrease locking.">release</a>();};
<a name="l00533"></a>00533 };
<a name="l00534"></a>00534 
<a name="l00547"></a><a class="code" href="a00157.html">00547</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">ThreadLock</a> : <span class="keyword">private</span> <a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>, <span class="keyword">public</span> <a class="code" href="a00049.html" title="An exclusive locking protocol interface base.">ExclusiveProtocol</a>, <span class="keyword">public</span> <a class="code" href="a00128.html" title="An exclusive locking protocol interface base.">SharedProtocol</a>
<a name="l00548"></a>00548 {
<a name="l00549"></a>00549 <span class="keyword">protected</span>:
<a name="l00550"></a>00550     <span class="keywordtype">unsigned</span> writers;
<a name="l00551"></a>00551     pthread_t writeid;
<a name="l00552"></a>00552 
<a name="l00553"></a>00553     <span class="keywordtype">void</span> <a class="code" href="a00049.html#ad1cf530ebd33ec7045fa13c2cd59b4b2" title="Protocol interface to exclusive lock the object.">Exlock</a>(<span class="keywordtype">void</span>);
<a name="l00554"></a>00554     <span class="keywordtype">void</span> <a class="code" href="a00128.html#aa4032345ba459dd96cda1bbf70b43e01" title="Protocol interface to share lock the object.">Shlock</a>(<span class="keywordtype">void</span>);
<a name="l00555"></a>00555     <span class="keywordtype">void</span> <a class="code" href="a00049.html#a16b87d186954541ad0ef2e6fc8e04070" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l00556"></a>00556 
<a name="l00557"></a>00557 <span class="keyword">public</span>:
<a name="l00565"></a><a class="code" href="a00158.html">00565</a>     <span class="keyword">class </span>__EXPORT <a class="code" href="a00158.html" title="Gaurd class to apply scope based access locking to objects.">gaurd_reader</a>
<a name="l00566"></a>00566     {
<a name="l00567"></a>00567     <span class="keyword">private</span>:
<a name="l00568"></a>00568         <span class="keywordtype">void</span> *object;
<a name="l00569"></a>00569 
<a name="l00570"></a>00570     <span class="keyword">public</span>:
<a name="l00575"></a>00575         <a class="code" href="a00158.html" title="Gaurd class to apply scope based access locking to objects.">gaurd_reader</a>();
<a name="l00576"></a>00576 
<a name="l00581"></a>00581         <a class="code" href="a00158.html" title="Gaurd class to apply scope based access locking to objects.">gaurd_reader</a>(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>);
<a name="l00582"></a>00582 
<a name="l00586"></a>00586         ~<a class="code" href="a00158.html" title="Gaurd class to apply scope based access locking to objects.">gaurd_reader</a>();
<a name="l00587"></a>00587 
<a name="l00593"></a>00593         <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">void</span> *object);
<a name="l00594"></a>00594 
<a name="l00598"></a>00598         <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00599"></a>00599 
<a name="l00605"></a><a class="code" href="a00158.html#a442aedf32b717243be25958633f6aad9">00605</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>)
<a name="l00606"></a>00606             {<span class="keyword">set</span>(pointer);};
<a name="l00607"></a>00607     };
<a name="l00608"></a>00608 
<a name="l00616"></a><a class="code" href="a00159.html">00616</a>     <span class="keyword">class </span>__EXPORT <a class="code" href="a00159.html" title="Gaurd class to apply scope based exclusive locking to objects.">gaurd_writer</a>
<a name="l00617"></a>00617     {
<a name="l00618"></a>00618     <span class="keyword">private</span>:
<a name="l00619"></a>00619         <span class="keywordtype">void</span> *object;
<a name="l00620"></a>00620 
<a name="l00621"></a>00621     <span class="keyword">public</span>:
<a name="l00626"></a>00626         <a class="code" href="a00159.html" title="Gaurd class to apply scope based exclusive locking to objects.">gaurd_writer</a>();
<a name="l00627"></a>00627 
<a name="l00632"></a>00632         <a class="code" href="a00159.html" title="Gaurd class to apply scope based exclusive locking to objects.">gaurd_writer</a>(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>);
<a name="l00633"></a>00633 
<a name="l00637"></a>00637         ~<a class="code" href="a00159.html" title="Gaurd class to apply scope based exclusive locking to objects.">gaurd_writer</a>();
<a name="l00638"></a>00638 
<a name="l00644"></a>00644         <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">void</span> *object);
<a name="l00645"></a>00645 
<a name="l00649"></a>00649         <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00650"></a>00650 
<a name="l00656"></a><a class="code" href="a00159.html#aeb6ed3678c57f68108e068363c164076">00656</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>)
<a name="l00657"></a>00657             {<span class="keyword">set</span>(pointer);};
<a name="l00658"></a>00658     };
<a name="l00659"></a>00659 
<a name="l00663"></a>00663     <a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">ThreadLock</a>();
<a name="l00664"></a>00664 
<a name="l00670"></a>00670     <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a7bbf6bb584edfaa7d0cf79c1312ea26f" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf);
<a name="l00671"></a>00671 
<a name="l00677"></a>00677     <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a5422fe5f7269f2606c8317e29e4147bf" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf);
<a name="l00678"></a>00678 
<a name="l00685"></a>00685     <span class="keyword">static</span> <span class="keywordtype">void</span> indexing(<span class="keywordtype">unsigned</span> size);
<a name="l00686"></a>00686 
<a name="l00694"></a>00694     <span class="keyword">static</span> <span class="keywordtype">bool</span> writer(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf);
<a name="l00695"></a>00695 
<a name="l00703"></a>00703     <span class="keyword">static</span> <span class="keywordtype">bool</span> reader(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf);
<a name="l00704"></a>00704 
<a name="l00709"></a>00709     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>);
<a name="l00710"></a>00710 
<a name="l00714"></a>00714     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00715"></a>00715 
<a name="l00720"></a>00720     <span class="keywordtype">unsigned</span> getAccess(<span class="keywordtype">void</span>);
<a name="l00721"></a>00721 
<a name="l00726"></a>00726     <span class="keywordtype">unsigned</span> getModify(<span class="keywordtype">void</span>);
<a name="l00727"></a>00727 
<a name="l00732"></a>00732     <span class="keywordtype">unsigned</span> getWaiting(<span class="keywordtype">void</span>);
<a name="l00733"></a>00733 
<a name="l00740"></a><a class="code" href="a00157.html#abb5420f1d1b6b3fd410a7070914c5dc2">00740</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a7bbf6bb584edfaa7d0cf79c1312ea26f" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">ThreadLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf)
<a name="l00741"></a>00741         {<span class="keywordflow">return</span> lock.<a class="code" href="a00157.html#a1bf92873e3b21e95702691d04a740bd2" title="Request modify (write) access through the lock.">modify</a>(timeout);};
<a name="l00742"></a>00742 
<a name="l00749"></a><a class="code" href="a00157.html#ab1be714922f7a5a95f456dc29ab4f8a7">00749</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a5422fe5f7269f2606c8317e29e4147bf" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">ThreadLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf)
<a name="l00750"></a>00750         {<span class="keywordflow">return</span> lock.<a class="code" href="a00157.html#a6809ba3a3e992cdd9f7688b4d9d52bb1" title="Request shared (read) access through the lock.">access</a>(timeout);};
<a name="l00751"></a>00751 
<a name="l00756"></a><a class="code" href="a00157.html#a96a09e595c1c8d0e12efd42b1103a227">00756</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">ThreadLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00757"></a>00757         {lock.<a class="code" href="a00157.html#adc28816b8692681307f59e29686402ec" title="Release an arbitrary object that has been protected by a rwlock.">release</a>();};
<a name="l00758"></a>00758 };
<a name="l00759"></a>00759 
<a name="l00770"></a><a class="code" href="a00115.html">00770</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00115.html" title="Class for resource bound memory pools between threads.">ReusableAllocator</a> : <span class="keyword">protected</span> <a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l00771"></a>00771 {
<a name="l00772"></a>00772 <span class="keyword">protected</span>:
<a name="l00773"></a>00773     <a class="code" href="a00116.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *freelist;
<a name="l00774"></a>00774     <span class="keywordtype">unsigned</span> waiting;
<a name="l00775"></a>00775 
<a name="l00779"></a>00779     <a class="code" href="a00115.html" title="Class for resource bound memory pools between threads.">ReusableAllocator</a>();
<a name="l00780"></a>00780 
<a name="l00786"></a><a class="code" href="a00115.html#acc1aad83051d6ecc3c1a0d36b312491d">00786</a>     <span class="keyword">inline</span> <a class="code" href="a00116.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *next(<a class="code" href="a00116.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keywordtype">object</span>)
<a name="l00787"></a>00787         {<span class="keywordflow">return</span> <span class="keywordtype">object</span>-&gt;getNext();};
<a name="l00788"></a>00788 
<a name="l00793"></a>00793     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00116.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keywordtype">object</span>);
<a name="l00794"></a>00794 };
<a name="l00795"></a>00795 
<a name="l00806"></a><a class="code" href="a00038.html">00806</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a> : <span class="keyword">protected</span> <a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>, <span class="keyword">public</span> <a class="code" href="a00128.html" title="An exclusive locking protocol interface base.">SharedProtocol</a>
<a name="l00807"></a>00807 {
<a name="l00808"></a>00808 <span class="keyword">protected</span>:
<a name="l00809"></a>00809     <span class="keyword">class </span>Context : <span class="keyword">public</span> <a class="code" href="a00067.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a>
<a name="l00810"></a>00810     {
<a name="l00811"></a>00811     <span class="keyword">public</span>:
<a name="l00812"></a>00812         <span class="keyword">inline</span> Context(<a class="code" href="a00067.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a> **root) : <a class="code" href="a00067.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a>(root) {};
<a name="l00813"></a>00813 
<a name="l00814"></a>00814         pthread_t thread;
<a name="l00815"></a>00815         <span class="keywordtype">unsigned</span> count;
<a name="l00816"></a>00816     };
<a name="l00817"></a>00817 
<a name="l00818"></a>00818     <a class="code" href="a00067.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a> *contexts;
<a name="l00819"></a>00819 
<a name="l00820"></a>00820     <span class="keywordtype">void</span> <a class="code" href="a00128.html#aa4032345ba459dd96cda1bbf70b43e01" title="Protocol interface to share lock the object.">Shlock</a>(<span class="keywordtype">void</span>);
<a name="l00821"></a>00821     <span class="keywordtype">void</span> <a class="code" href="a00128.html#a94e79428fccab57606c5f00bc6b833fd" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l00822"></a>00822     <span class="keywordtype">void</span> <a class="code" href="a00128.html#af0abe5b2d57ac6ccf98cdc151c61915a" title="Convert object to an exclusive lock.">Exclusive</a>(<span class="keywordtype">void</span>);
<a name="l00823"></a>00823     <span class="keywordtype">void</span> <a class="code" href="a00128.html#ae3758b5d521a35cd283d4f6329564f9f" title="Share the lock with other referencers.">Share</a>(<span class="keywordtype">void</span>);
<a name="l00824"></a>00824     Context *getContext(<span class="keywordtype">void</span>);
<a name="l00825"></a>00825 
<a name="l00826"></a>00826 <span class="keyword">public</span>:
<a name="l00830"></a>00830     <a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>();
<a name="l00831"></a>00831 
<a name="l00835"></a>00835     ~<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>();
<a name="l00836"></a>00836 
<a name="l00840"></a>00840     <span class="keywordtype">void</span> <a class="code" href="a00037.html#a69bb754c052d0915defd46d96e346a7c" title="Exclusive mode write thread scheduling.">modify</a>(<span class="keywordtype">void</span>);
<a name="l00841"></a>00841 
<a name="l00845"></a>00845     <span class="keywordtype">void</span> <a class="code" href="a00037.html#a7555ff21951000954a00355ceaf32bb3" title="Complete exclusive mode write scheduling.">commit</a>(<span class="keywordtype">void</span>);
<a name="l00846"></a>00846 
<a name="l00850"></a>00850     <span class="keywordtype">void</span> <a class="code" href="a00037.html#a0e45df81148cfcb5cc2e197dc751972b" title="Access mode shared thread scheduling.">access</a>(<span class="keywordtype">void</span>);
<a name="l00851"></a>00851 
<a name="l00855"></a>00855     <span class="keywordtype">void</span> <a class="code" href="a00037.html#a3a5a54da9274122f0d944f820eb1a806" title="Release access mode read scheduling.">release</a>(<span class="keywordtype">void</span>);
<a name="l00856"></a>00856 
<a name="l00861"></a>00861     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a38f16b6c76465ba13751ff3b5be4a41e" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<span class="keywordtype">void</span>);
<a name="l00862"></a>00862 
<a name="l00866"></a>00866     <span class="keywordtype">void</span> <a class="code" href="a00208.html#aa738a981d717c379a3facda88eafbdea" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol...">share</a>(<span class="keywordtype">void</span>);
<a name="l00867"></a>00867 
<a name="l00871"></a>00871     <span class="keywordtype">unsigned</span> getReaders(<span class="keywordtype">void</span>);
<a name="l00872"></a>00872 
<a name="l00876"></a>00876     <span class="keywordtype">unsigned</span> getWaiters(<span class="keywordtype">void</span>);
<a name="l00877"></a>00877 
<a name="l00882"></a><a class="code" href="a00038.html#a414b4a687d9323562bd6cd251d119165">00882</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00037.html#a69bb754c052d0915defd46d96e346a7c" title="Exclusive mode write thread scheduling.">modify</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00883"></a>00883         {lock.<a class="code" href="a00038.html#a3d3a37cc1d24d1326deb9755ce0f6171" title="Acquire write (exclusive modify) lock.">modify</a>();};
<a name="l00884"></a>00884 
<a name="l00889"></a><a class="code" href="a00038.html#ac36f33d35e7fd2923474f449e5c936e0">00889</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00037.html#a7555ff21951000954a00355ceaf32bb3" title="Complete exclusive mode write scheduling.">commit</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00890"></a>00890         {lock.<a class="code" href="a00038.html#aa8b1287c294c8abc9c30000e9d5b9052" title="Commit changes / release a modify lock.">commit</a>();};
<a name="l00891"></a>00891 
<a name="l00896"></a><a class="code" href="a00038.html#ad4c0de381629b9170cbdf8132d2d3a70">00896</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00037.html#a3a5a54da9274122f0d944f820eb1a806" title="Release access mode read scheduling.">release</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00897"></a>00897         {lock.<a class="code" href="a00038.html#ae9a0b040d4d65870ac7d67d2b96cea50" title="Release a shared lock.">release</a>();};
<a name="l00898"></a>00898 
<a name="l00903"></a><a class="code" href="a00038.html#a7428dc9f2df3b5c4685504bf2d4be6f3">00903</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00037.html#a0e45df81148cfcb5cc2e197dc751972b" title="Access mode shared thread scheduling.">access</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00904"></a>00904         {lock.<a class="code" href="a00038.html#a6c50babda6e4c056be90b754738d2d5d" title="Acquire access (shared read) lock.">access</a>();};
<a name="l00905"></a>00905 
<a name="l00910"></a><a class="code" href="a00038.html#a00f128ae4b96d7895c8a446e829abd5c">00910</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a38f16b6c76465ba13751ff3b5be4a41e" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00911"></a>00911         {lock.<a class="code" href="a00038.html#a719bfdd193be78ad51d5b034822fbb2f" title="Convert read lock into exclusive (write/modify) access.">exclusive</a>();};
<a name="l00912"></a>00912 
<a name="l00917"></a><a class="code" href="a00038.html#a8e837361f4ecdef09b86ff51e14c0249">00917</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#aa738a981d717c379a3facda88eafbdea" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol...">share</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00918"></a>00918         {lock.<a class="code" href="a00038.html#a93aa50cae673c104a3436940de1e63b8" title="Return an exclusive access lock back to share mode.">share</a>();};
<a name="l00919"></a>00919 };
<a name="l00920"></a>00920 
<a name="l00933"></a><a class="code" href="a00024.html">00933</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a> : <span class="keyword">private</span> <a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l00934"></a>00934 {
<a name="l00935"></a>00935 <span class="keyword">private</span>:
<a name="l00936"></a>00936     <span class="keywordtype">unsigned</span> count;
<a name="l00937"></a>00937     <span class="keywordtype">unsigned</span> waits;
<a name="l00938"></a>00938 
<a name="l00939"></a>00939 <span class="keyword">public</span>:
<a name="l00944"></a>00944     <a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>(<span class="keywordtype">unsigned</span> count);
<a name="l00945"></a>00945 
<a name="l00949"></a>00949     ~<a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>();
<a name="l00950"></a>00950 
<a name="l00956"></a>00956     <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">unsigned</span> count);
<a name="l00957"></a>00957 
<a name="l00961"></a>00961     <span class="keywordtype">void</span> inc(<span class="keywordtype">void</span>);
<a name="l00962"></a>00962 
<a name="l00966"></a>00966     <span class="keywordtype">void</span> dec(<span class="keywordtype">void</span>);
<a name="l00967"></a>00967 
<a name="l00972"></a>00972     <span class="keywordtype">unsigned</span> operator++(<span class="keywordtype">void</span>);
<a name="l00973"></a>00973 
<a name="l00974"></a>00974     <span class="keywordtype">unsigned</span> operator--(<span class="keywordtype">void</span>);
<a name="l00975"></a>00975 
<a name="l00979"></a>00979     <span class="keywordtype">void</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<span class="keywordtype">void</span>);
<a name="l00980"></a>00980 
<a name="l00987"></a>00987     <span class="keywordtype">bool</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00988"></a>00988 
<a name="l00993"></a><a class="code" href="a00024.html#a232b2ee42344b815808e657602df5e31">00993</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>&amp; sync)
<a name="l00994"></a>00994         {sync.<a class="code" href="a00024.html#abac6db6b75abd87d2cf515dd55a40625" title="Wait at the barrier until the count of threads waiting is reached.">wait</a>();};
<a name="l00995"></a>00995 
<a name="l01002"></a><a class="code" href="a00024.html#abf46e58043b584e64b9b19f976304925">01002</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>&amp; sync, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l01003"></a>01003         {<span class="keywordflow">return</span> sync.<a class="code" href="a00024.html#abac6db6b75abd87d2cf515dd55a40625" title="Wait at the barrier until the count of threads waiting is reached.">wait</a>(timeout);};
<a name="l01004"></a>01004 
<a name="l01005"></a>01005 
<a name="l01011"></a><a class="code" href="a00024.html#a45853f41bd7e1244344d67f196d525ee">01011</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>&amp; sync, <span class="keywordtype">unsigned</span> count)
<a name="l01012"></a>01012         {sync.set(count);};
<a name="l01013"></a>01013 };
<a name="l01014"></a>01014 
<a name="l01023"></a><a class="code" href="a00119.html">01023</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00119.html" title="A portable counting semaphore class.">Semaphore</a> : <span class="keyword">public</span> <a class="code" href="a00128.html" title="An exclusive locking protocol interface base.">SharedProtocol</a>, <span class="keyword">protected</span> <a class="code" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l01024"></a>01024 {
<a name="l01025"></a>01025 <span class="keyword">protected</span>:
<a name="l01026"></a>01026     <span class="keywordtype">unsigned</span> count, waits, used;
<a name="l01027"></a>01027 
<a name="l01028"></a>01028     <span class="keywordtype">void</span> <a class="code" href="a00128.html#aa4032345ba459dd96cda1bbf70b43e01" title="Protocol interface to share lock the object.">Shlock</a>(<span class="keywordtype">void</span>);
<a name="l01029"></a>01029     <span class="keywordtype">void</span> <a class="code" href="a00128.html#a94e79428fccab57606c5f00bc6b833fd" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l01030"></a>01030 
<a name="l01031"></a>01031 <span class="keyword">public</span>:
<a name="l01035"></a>01035     <a class="code" href="a00119.html" title="A portable counting semaphore class.">Semaphore</a>(<span class="keywordtype">unsigned</span> count = 0);
<a name="l01036"></a>01036 
<a name="l01041"></a>01041     <span class="keywordtype">void</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<span class="keywordtype">void</span>);
<a name="l01042"></a>01042 
<a name="l01050"></a>01050     <span class="keywordtype">bool</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l01051"></a>01051 
<a name="l01056"></a>01056     <span class="keywordtype">unsigned</span> getCount(<span class="keywordtype">void</span>);
<a name="l01057"></a>01057 
<a name="l01062"></a>01062     <span class="keywordtype">unsigned</span> getUsed(<span class="keywordtype">void</span>);
<a name="l01063"></a>01063 
<a name="l01068"></a>01068     <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">unsigned</span> count);
<a name="l01069"></a>01069 
<a name="l01073"></a>01073     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01074"></a>01074 
<a name="l01078"></a><a class="code" href="a00119.html#a5a7efd68b786a31e1f3eb96fba44a305">01078</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> operator++(<span class="keywordtype">void</span>)
<a name="l01079"></a>01079         {<a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>();};
<a name="l01080"></a>01080 
<a name="l01084"></a><a class="code" href="a00119.html#a4be4acc6e221898d8141345a3c740a29">01084</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> operator--(<span class="keywordtype">void</span>)
<a name="l01085"></a>01085         {<a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>();};
<a name="l01086"></a>01086 
<a name="l01091"></a><a class="code" href="a00119.html#a4b9c535b4a1a2a990a0e36bf1965b235">01091</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00119.html" title="A portable counting semaphore class.">Semaphore</a>&amp; sync)
<a name="l01092"></a>01092         {sync.<a class="code" href="a00119.html#acd81d0597579f11e7302467f8e1a1a17" title="Wait until the semphore usage count is less than the thread limit.">wait</a>();};
<a name="l01093"></a>01093 
<a name="l01100"></a><a class="code" href="a00119.html#ac22d44843eccfa94aef327040dfe1e00">01100</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00036.html#a32b09f4b5196eeef1a7ba7066ec06cc4" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00119.html" title="A portable counting semaphore class.">Semaphore</a>&amp; sync, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l01101"></a>01101         {<span class="keywordflow">return</span> sync.<a class="code" href="a00119.html#acd81d0597579f11e7302467f8e1a1a17" title="Wait until the semphore usage count is less than the thread limit.">wait</a>(timeout);};
<a name="l01102"></a>01102 
<a name="l01107"></a><a class="code" href="a00119.html#ac525ed765811fb1f0867f740785ac353">01107</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00119.html" title="A portable counting semaphore class.">Semaphore</a>&amp; sync)
<a name="l01108"></a>01108         {sync.<a class="code" href="a00119.html#ab75f833b69046a147260881d3cc51415" title="Release the semaphore after waiting for it.">release</a>();};
<a name="l01109"></a>01109 };
<a name="l01110"></a>01110 
<a name="l01124"></a><a class="code" href="a00086.html">01124</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a> : <span class="keyword">public</span> <a class="code" href="a00049.html" title="An exclusive locking protocol interface base.">ExclusiveProtocol</a>
<a name="l01125"></a>01125 {
<a name="l01126"></a>01126 <span class="keyword">protected</span>:
<a name="l01127"></a>01127     pthread_mutex_t mlock;
<a name="l01128"></a>01128 
<a name="l01129"></a>01129     <span class="keywordtype">void</span> <a class="code" href="a00049.html#ad1cf530ebd33ec7045fa13c2cd59b4b2" title="Protocol interface to exclusive lock the object.">Exlock</a>(<span class="keywordtype">void</span>);
<a name="l01130"></a>01130     <span class="keywordtype">void</span> <a class="code" href="a00049.html#a16b87d186954541ad0ef2e6fc8e04070" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l01131"></a>01131 
<a name="l01132"></a>01132 <span class="keyword">public</span>:
<a name="l01140"></a><a class="code" href="a00087.html">01140</a>     <span class="keyword">class </span>__EXPORT <a class="code" href="a00087.html" title="Gaurd class to apply scope based mutex locking to objects.">gaurd</a>
<a name="l01141"></a>01141     {
<a name="l01142"></a>01142     <span class="keyword">private</span>:
<a name="l01143"></a>01143         <span class="keywordtype">void</span> *object;
<a name="l01144"></a>01144 
<a name="l01145"></a>01145     <span class="keyword">public</span>:
<a name="l01150"></a>01150         <a class="code" href="a00087.html" title="Gaurd class to apply scope based mutex locking to objects.">gaurd</a>();
<a name="l01151"></a>01151 
<a name="l01156"></a>01156         <a class="code" href="a00087.html" title="Gaurd class to apply scope based mutex locking to objects.">gaurd</a>(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>);
<a name="l01157"></a>01157 
<a name="l01161"></a>01161         ~<a class="code" href="a00087.html" title="Gaurd class to apply scope based mutex locking to objects.">gaurd</a>();
<a name="l01162"></a>01162 
<a name="l01168"></a>01168         <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">void</span> *object);
<a name="l01169"></a>01169 
<a name="l01173"></a>01173         <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01174"></a>01174 
<a name="l01180"></a><a class="code" href="a00087.html#a1c7afa47570b597bfde4ff7d52327002">01180</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>)
<a name="l01181"></a>01181             {<span class="keyword">set</span>(pointer);};
<a name="l01182"></a>01182     };
<a name="l01183"></a>01183 
<a name="l01184"></a>01184 
<a name="l01188"></a>01188     <a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a>();
<a name="l01189"></a>01189 
<a name="l01193"></a>01193     ~<a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a>();
<a name="l01194"></a>01194 
<a name="l01198"></a><a class="code" href="a00086.html#ab37230b043ba152aa16cf6ede193cbea">01198</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c813dcccc3a9eec6a0da47efcac7a1f" title="Convenience function to acquire a mutex.">acquire</a>(<span class="keywordtype">void</span>)
<a name="l01199"></a>01199         {pthread_mutex_lock(&amp;mlock);};
<a name="l01200"></a>01200 
<a name="l01204"></a><a class="code" href="a00086.html#adac15f4646a7dc0bef489f9179771d0f">01204</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>)
<a name="l01205"></a>01205         {pthread_mutex_lock(&amp;mlock);};
<a name="l01206"></a>01206 
<a name="l01210"></a><a class="code" href="a00086.html#ade2d4978d76ef5bbe2ecef272a3ce20e">01210</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a06fc306b76334e4410e554d683ae790b" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l01211"></a>01211         {pthread_mutex_unlock(&amp;mlock);};
<a name="l01212"></a>01212 
<a name="l01216"></a><a class="code" href="a00086.html#aa8e309c56ee0ff9f2d463b82c2e20030">01216</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>)
<a name="l01217"></a>01217         {pthread_mutex_unlock(&amp;mlock);};
<a name="l01218"></a>01218 
<a name="l01223"></a><a class="code" href="a00086.html#a2b428e753f401cd056f976fa5deb845e">01223</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c813dcccc3a9eec6a0da47efcac7a1f" title="Convenience function to acquire a mutex.">acquire</a>(<a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01224"></a>01224         {pthread_mutex_lock(&amp;lock.mlock);};
<a name="l01225"></a>01225 
<a name="l01230"></a><a class="code" href="a00086.html#a2811a152b6c7dd87b2d8fd2cff4d3a04">01230</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01231"></a>01231         {pthread_mutex_lock(&amp;lock.mlock);};
<a name="l01232"></a>01232 
<a name="l01237"></a><a class="code" href="a00086.html#ae950c5f55dbe606e84f63d1f61cd71ee">01237</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a06fc306b76334e4410e554d683ae790b" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01238"></a>01238         {pthread_mutex_unlock(&amp;lock.mlock);};
<a name="l01239"></a>01239 
<a name="l01244"></a><a class="code" href="a00086.html#ab41d6aa91367b09cfebdecbc22f4eccd">01244</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a>&amp; <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01245"></a>01245         {pthread_mutex_unlock(&amp;lock.mlock);};
<a name="l01246"></a>01246 
<a name="l01251"></a><a class="code" href="a00086.html#a61c2c7106f20b90c457c542f027c8d2c">01251</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c813dcccc3a9eec6a0da47efcac7a1f" title="Convenience function to acquire a mutex.">acquire</a>(pthread_mutex_t *<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01252"></a>01252         {pthread_mutex_lock(lock);};
<a name="l01253"></a>01253 
<a name="l01258"></a><a class="code" href="a00086.html#adafb6867e79d5d807ee17d9998d17e3b">01258</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(pthread_mutex_t *<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01259"></a>01259         {pthread_mutex_lock(lock);};
<a name="l01260"></a>01260 
<a name="l01265"></a><a class="code" href="a00086.html#ae82390643ddd6199e85b01e6f12aa55d">01265</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a06fc306b76334e4410e554d683ae790b" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(pthread_mutex_t *<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01266"></a>01266         {pthread_mutex_unlock(lock);};
<a name="l01267"></a>01267 
<a name="l01272"></a><a class="code" href="a00086.html#a23db5f7b655e104fd5258a78c777da62">01272</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(pthread_mutex_t *<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01273"></a>01273         {pthread_mutex_unlock(lock);};
<a name="l01274"></a>01274 
<a name="l01281"></a>01281     <span class="keyword">static</span> <span class="keywordtype">void</span> indexing(<span class="keywordtype">unsigned</span> size);
<a name="l01282"></a>01282 
<a name="l01288"></a>01288     <span class="keyword">static</span> <span class="keywordtype">void</span> protect(<span class="keywordtype">void</span> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01289"></a>01289 
<a name="l01294"></a>01294     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01295"></a>01295 };
<a name="l01296"></a>01296 
<a name="l01305"></a><a class="code" href="a00022.html">01305</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>
<a name="l01306"></a>01306 {
<a name="l01307"></a>01307 <span class="keyword">private</span>:
<a name="l01308"></a>01308     <span class="comment">// cannot copy...</span>
<a name="l01309"></a>01309     <span class="keyword">inline</span> <a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>(<span class="keyword">const</span> <a class="code" href="a00021.html" title="A general purpose smart pointer helper class.">auto_object</a> &amp;<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>) {};
<a name="l01310"></a>01310 
<a name="l01311"></a>01311 <span class="keyword">protected</span>:
<a name="l01312"></a>01312     <span class="keywordtype">void</span> *object;
<a name="l01313"></a>01313 
<a name="l01314"></a>01314     <a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>();
<a name="l01315"></a>01315 
<a name="l01316"></a>01316 <span class="keyword">public</span>:
<a name="l01321"></a>01321     <a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>);
<a name="l01322"></a>01322 
<a name="l01327"></a>01327     ~<a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>();
<a name="l01328"></a>01328 
<a name="l01332"></a>01332     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01333"></a>01333 
<a name="l01338"></a><a class="code" href="a00022.html#aa2d014a5a04a15e3f7dec7d02ee727fe">01338</a>     <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()<span class="keyword"> const</span>
<a name="l01339"></a>01339 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keywordtype">object</span> == NULL;};
<a name="l01340"></a>01340 
<a name="l01345"></a><a class="code" href="a00022.html#a8c55ba7666d5767e6e08166209d26de0">01345</a>     <span class="keyword">inline</span> operator bool()<span class="keyword"> const</span>
<a name="l01346"></a>01346 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keywordtype">object</span> != NULL;};
<a name="l01347"></a>01347 
<a name="l01354"></a>01354     <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>);
<a name="l01355"></a>01355 };
<a name="l01356"></a>01356 
<a name="l01368"></a><a class="code" href="a00072.html">01368</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00072.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>
<a name="l01369"></a>01369 {
<a name="l01370"></a>01370 <span class="keyword">private</span>:
<a name="l01371"></a>01371     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>;
<a name="l01372"></a>01372     pthread_mutex_t mutex;
<a name="l01373"></a>01373     <a class="code" href="a00095.html" title="A common base class for all managed objects.">ObjectProtocol</a> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>;
<a name="l01374"></a>01374 
<a name="l01375"></a>01375 <span class="keyword">protected</span>:
<a name="l01379"></a>01379     <a class="code" href="a00072.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>();
<a name="l01380"></a>01380 
<a name="l01385"></a>01385     <span class="keywordtype">void</span> replace(<a class="code" href="a00095.html" title="A common base class for all managed objects.">ObjectProtocol</a> *<span class="keywordtype">object</span>);
<a name="l01386"></a>01386 
<a name="l01391"></a>01391     <a class="code" href="a00095.html" title="A common base class for all managed objects.">ObjectProtocol</a> *<a class="code" href="a00208.html#a8048c8716eafab6b193a59529650db5c" title="Convenience function to duplicate object pointer to heap.">dup</a>(<span class="keywordtype">void</span>);
<a name="l01392"></a>01392 
<a name="l01397"></a><a class="code" href="a00072.html#abf806d21b405e05122b40f09024f5521">01397</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<a class="code" href="a00095.html" title="A common base class for all managed objects.">ObjectProtocol</a> *<span class="keywordtype">object</span>)
<a name="l01398"></a>01398         {replace(<span class="keywordtype">object</span>);};
<a name="l01399"></a>01399 };
<a name="l01400"></a>01400 
<a name="l01409"></a><a class="code" href="a00126.html">01409</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00126.html" title="Shared singleton object.">SharedObject</a>
<a name="l01410"></a>01410 {
<a name="l01411"></a>01411 <span class="keyword">protected</span>:
<a name="l01412"></a>01412     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>;
<a name="l01413"></a>01413 
<a name="l01422"></a>01422     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#af77af9c36e881ef569e2fb1bf5dca1d6" title="Convenience function to commit an exclusive access lock.">commit</a>(<a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01423"></a>01423 
<a name="l01424"></a>01424 <span class="keyword">public</span>:
<a name="l01428"></a>01428     <span class="keyword">virtual</span> ~<a class="code" href="a00126.html" title="Shared singleton object.">SharedObject</a>();
<a name="l01429"></a>01429 };
<a name="l01430"></a>01430 
<a name="l01441"></a><a class="code" href="a00127.html">01441</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> : <span class="keyword">protected</span> <a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>
<a name="l01442"></a>01442 {
<a name="l01443"></a>01443 <span class="keyword">private</span>:
<a name="l01444"></a>01444     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>;
<a name="l01445"></a>01445     <a class="code" href="a00126.html" title="Shared singleton object.">SharedObject</a> *<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>;
<a name="l01446"></a>01446 
<a name="l01447"></a>01447 <span class="keyword">protected</span>:
<a name="l01451"></a>01451     <a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>();
<a name="l01452"></a>01452 
<a name="l01456"></a>01456     ~<a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>();
<a name="l01457"></a>01457 
<a name="l01464"></a>01464     <span class="keywordtype">void</span> replace(<a class="code" href="a00126.html" title="Shared singleton object.">SharedObject</a> *<span class="keywordtype">object</span>);
<a name="l01465"></a>01465 
<a name="l01472"></a>01472     <a class="code" href="a00126.html" title="Shared singleton object.">SharedObject</a> *<a class="code" href="a00208.html#aa738a981d717c379a3facda88eafbdea" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol...">share</a>(<span class="keywordtype">void</span>);
<a name="l01473"></a>01473 };
<a name="l01474"></a>01474 
<a name="l01485"></a><a class="code" href="a00156.html">01485</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00156.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>
<a name="l01486"></a>01486 {
<a name="l01487"></a>01487 <span class="keyword">protected</span>:
<a name="l01488"></a>01488 <span class="comment">// may be used in future if we need cancelable threads...</span>
<a name="l01489"></a>01489 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l01490"></a>01490 <span class="preprocessor"></span>    HANDLE cancellor;
<a name="l01491"></a>01491 <span class="preprocessor">#else</span>
<a name="l01492"></a>01492 <span class="preprocessor"></span>    <span class="keywordtype">void</span> *cancellor;
<a name="l01493"></a>01493 <span class="preprocessor">#endif</span>
<a name="l01494"></a>01494 <span class="preprocessor"></span>
<a name="l01495"></a>01495     <span class="keyword">enum</span> {} reserved;   <span class="comment">// cancel mode?</span>
<a name="l01496"></a>01496     pthread_t tid;
<a name="l01497"></a>01497     <span class="keywordtype">size_t</span> <a class="code" href="a00145.html" title="Manage a thread-safe stack of objects through reference pointers.">stack</a>;
<a name="l01498"></a>01498     <span class="keywordtype">int</span> priority;
<a name="l01499"></a>01499 
<a name="l01505"></a>01505     <a class="code" href="a00156.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>(<span class="keywordtype">size_t</span> <a class="code" href="a00145.html" title="Manage a thread-safe stack of objects through reference pointers.">stack</a> = 0);
<a name="l01506"></a>01506 
<a name="l01511"></a>01511     <span class="keywordtype">void</span> map(<span class="keywordtype">void</span>);
<a name="l01512"></a>01512 
<a name="l01513"></a>01513 <span class="keyword">public</span>:
<a name="l01520"></a>01520     <span class="keywordtype">void</span> setPriority(<span class="keywordtype">void</span>);
<a name="l01521"></a>01521 
<a name="l01526"></a>01526     <span class="keyword">static</span> <span class="keywordtype">void</span> yield(<span class="keywordtype">void</span>);
<a name="l01527"></a>01527 
<a name="l01532"></a>01532     <span class="keyword">static</span> <span class="keywordtype">void</span> sleep(<a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l01533"></a>01533 
<a name="l01540"></a>01540     <span class="keyword">static</span> <a class="code" href="a00156.html" title="An abstract class for defining classes that operate as a thread.">Thread</a> *<span class="keyword">get</span>(void);
<a name="l01541"></a>01541 
<a name="l01545"></a>01545     <span class="keyword">virtual</span> <span class="keywordtype">void</span> run(<span class="keywordtype">void</span>) = 0;
<a name="l01546"></a>01546 
<a name="l01550"></a>01550     <span class="keyword">virtual</span> ~<a class="code" href="a00156.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>();
<a name="l01551"></a>01551 
<a name="l01560"></a>01560     <span class="keyword">virtual</span> <span class="keywordtype">void</span> exit(<span class="keywordtype">void</span>);
<a name="l01561"></a>01561 
<a name="l01565"></a>01565     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00194.html#a5fc126f9a4406cb2d0d054488cf00809" title="Template function to initialize memory by invoking default constructor.">init</a>(<span class="keywordtype">void</span>);
<a name="l01566"></a>01566 
<a name="l01572"></a>01572     <span class="keyword">static</span> <span class="keywordtype">void</span> policy(<span class="keywordtype">int</span> polid);
<a name="l01573"></a>01573 
<a name="l01578"></a>01578     <span class="keyword">static</span> <span class="keywordtype">void</span> concurrency(<span class="keywordtype">int</span> level);
<a name="l01579"></a>01579 
<a name="l01586"></a>01586     <span class="keyword">static</span> <span class="keywordtype">bool</span> equal(pthread_t thread1, pthread_t thread2);
<a name="l01587"></a>01587 
<a name="l01592"></a>01592     <span class="keyword">static</span> pthread_t <span class="keyword">self</span>(void);
<a name="l01593"></a>01593 
<a name="l01597"></a>01597     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> isRunning(<span class="keywordtype">void</span>);
<a name="l01598"></a>01598 
<a name="l01599"></a>01599     <span class="keyword">inline</span> operator bool()
<a name="l01600"></a>01600         {<span class="keywordflow">return</span> isRunning();}
<a name="l01601"></a>01601 };
<a name="l01602"></a>01602 
<a name="l01613"></a><a class="code" href="a00053.html">01613</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00053.html" title="A child thread object that may be joined by parent.">JoinableThread</a> : <span class="keyword">protected</span> <a class="code" href="a00156.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>
<a name="l01614"></a>01614 {
<a name="l01615"></a>01615 <span class="keyword">protected</span>:
<a name="l01616"></a>01616 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l01617"></a>01617 <span class="preprocessor"></span>    HANDLE running;
<a name="l01618"></a>01618 <span class="preprocessor">#else</span>
<a name="l01619"></a>01619 <span class="preprocessor"></span>    <span class="keyword">volatile</span> <span class="keywordtype">bool</span> running;
<a name="l01620"></a>01620 <span class="preprocessor">#endif</span>
<a name="l01621"></a>01621 <span class="preprocessor"></span>    <span class="keyword">volatile</span> <span class="keywordtype">bool</span> joining;
<a name="l01622"></a>01622 
<a name="l01627"></a>01627     <a class="code" href="a00053.html" title="A child thread object that may be joined by parent.">JoinableThread</a>(<span class="keywordtype">size_t</span> size = 0);
<a name="l01628"></a>01628 
<a name="l01633"></a>01633     <span class="keyword">virtual</span> ~<a class="code" href="a00053.html" title="A child thread object that may be joined by parent.">JoinableThread</a>();
<a name="l01634"></a>01634 
<a name="l01640"></a>01640     <span class="keywordtype">void</span> join(<span class="keywordtype">void</span>);
<a name="l01641"></a>01641 
<a name="l01642"></a>01642 <span class="keyword">public</span>:
<a name="l01643"></a>01643     <span class="keywordtype">bool</span> <a class="code" href="a00156.html#aa7fcaa41a2df0a8fa1e6bc80dcdc5a90" title="Check if running.">isRunning</a>(<span class="keywordtype">void</span>);
<a name="l01644"></a>01644 
<a name="l01653"></a>01653     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c62610106837fc4ebbe70e9001bdb2f" title="Convenience function to start a joinable thread.">start</a>(<span class="keywordtype">int</span> priority = 0);
<a name="l01654"></a>01654 
<a name="l01659"></a><a class="code" href="a00053.html#afa0a81a0ff6776780a97566848fcab0b">01659</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> background(<span class="keywordtype">void</span>)
<a name="l01660"></a>01660         {<a class="code" href="a00208.html#a3c62610106837fc4ebbe70e9001bdb2f" title="Convenience function to start a joinable thread.">start</a>(-1);};
<a name="l01661"></a>01661 };
<a name="l01662"></a>01662 
<a name="l01670"></a><a class="code" href="a00045.html">01670</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00045.html" title="A detached thread object that is stand-alone.">DetachedThread</a> : <span class="keyword">protected</span> <a class="code" href="a00156.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>
<a name="l01671"></a>01671 {
<a name="l01672"></a>01672 <span class="keyword">protected</span>:
<a name="l01673"></a>01673     <span class="keywordtype">bool</span> active;
<a name="l01674"></a>01674 
<a name="l01679"></a>01679     <a class="code" href="a00045.html" title="A detached thread object that is stand-alone.">DetachedThread</a>(<span class="keywordtype">size_t</span> size = 0);
<a name="l01680"></a>01680 
<a name="l01686"></a>01686     ~<a class="code" href="a00045.html" title="A detached thread object that is stand-alone.">DetachedThread</a>();
<a name="l01687"></a>01687 
<a name="l01696"></a>01696     <span class="keywordtype">void</span> <a class="code" href="a00156.html#a6673eee6bba2a045f78bb12774bf52e9" title="Exit the thread context.">exit</a>(<span class="keywordtype">void</span>);
<a name="l01697"></a>01697 
<a name="l01698"></a>01698 <span class="keyword">public</span>:
<a name="l01705"></a>01705     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c62610106837fc4ebbe70e9001bdb2f" title="Convenience function to start a joinable thread.">start</a>(<span class="keywordtype">int</span> priority = 0);
<a name="l01706"></a>01706 
<a name="l01707"></a>01707     <span class="keywordtype">bool</span> <a class="code" href="a00156.html#aa7fcaa41a2df0a8fa1e6bc80dcdc5a90" title="Check if running.">isRunning</a>(<span class="keywordtype">void</span>);
<a name="l01708"></a>01708 };
<a name="l01709"></a>01709 
<a name="l01718"></a><a class="code" href="a00071.html">01718</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>
<a name="l01719"></a>01719 {
<a name="l01720"></a>01720 <span class="keyword">protected</span>:
<a name="l01721"></a><a class="code" href="a00071.html#a2310566361a78e237abc1ab7d871312c">01721</a>     <a class="code" href="a00095.html" title="A common base class for all managed objects.">ObjectProtocol</a> *object; 
<a name="l01726"></a>01726     <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>();
<a name="l01727"></a>01727 
<a name="l01733"></a>01733     <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>(<span class="keyword">const</span> <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a> &amp;<span class="keywordtype">object</span>);
<a name="l01734"></a>01734 
<a name="l01735"></a>01735 <span class="keyword">public</span>:
<a name="l01741"></a>01741     <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>(<a class="code" href="a00072.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a> &amp;<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01742"></a>01742 
<a name="l01747"></a>01747     ~<a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>();
<a name="l01748"></a>01748 
<a name="l01752"></a>01752     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01753"></a>01753 
<a name="l01759"></a>01759     <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a> &amp;operator=(<a class="code" href="a00072.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a> &amp;<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01760"></a>01760 };
<a name="l01761"></a>01761 
<a name="l01771"></a><a class="code" href="a00125.html">01771</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>
<a name="l01772"></a>01772 {
<a name="l01773"></a>01773 <span class="keyword">protected</span>:
<a name="l01774"></a><a class="code" href="a00125.html#ae2b5c5ea2766a8bcad6f426a16919c0f">01774</a>     <a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> *ptr; 
<a name="l01779"></a>01779     <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>();
<a name="l01780"></a>01780 
<a name="l01786"></a>01786     <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>(<span class="keyword">const</span> <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a> &amp;<span class="keywordtype">object</span>);
<a name="l01787"></a>01787 
<a name="l01788"></a>01788 <span class="keyword">public</span>:
<a name="l01793"></a>01793     <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>(<a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> &amp;<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01794"></a>01794 
<a name="l01800"></a>01800     ~<a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>();
<a name="l01801"></a>01801 
<a name="l01805"></a>01805     <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01806"></a>01806 
<a name="l01811"></a>01811     <a class="code" href="a00126.html" title="Shared singleton object.">SharedObject</a> *<span class="keyword">get</span>(void);
<a name="l01812"></a>01812 
<a name="l01818"></a>01818     <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a> &amp;operator=(<a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> &amp;<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01819"></a>01819 };
<a name="l01820"></a>01820 
<a name="l01828"></a>01828 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01829"></a><a class="code" href="a00124.html">01829</a> <span class="keyword">class </span><a class="code" href="a00124.html" title="Templated shared pointer for singleton shared objects of specific type.">shared_pointer</a> : <span class="keyword">public</span> <a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>
<a name="l01830"></a>01830 {
<a name="l01831"></a>01831 <span class="keyword">public</span>:
<a name="l01835"></a><a class="code" href="a00124.html#ac1eda7d9ebc8f9a8d7732f5ed48db906">01835</a>     <span class="keyword">inline</span> <a class="code" href="a00124.html#ac1eda7d9ebc8f9a8d7732f5ed48db906" title="Created shared locking for typed singleton pointer.">shared_pointer</a>() : <a class="code" href="a00127.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>() {};
<a name="l01836"></a>01836 
<a name="l01844"></a><a class="code" href="a00124.html#a4fd9d2aa0c289fbe9d6c3fb7cb86da63">01844</a>     <span class="keyword">inline</span> <span class="keyword">const</span> T *<a class="code" href="a00208.html#a8048c8716eafab6b193a59529650db5c" title="Convenience function to duplicate object pointer to heap.">dup</a>(<span class="keywordtype">void</span>)
<a name="l01845"></a>01845         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(<a class="code" href="a00208.html#aa738a981d717c379a3facda88eafbdea" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol...">SharedPointer::share</a>());};
<a name="l01846"></a>01846 
<a name="l01853"></a><a class="code" href="a00124.html#aee893814ee0e56640b19e670c12f3625">01853</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> replace(T *<span class="keywordtype">object</span>)
<a name="l01854"></a>01854         {SharedPointer::replace(<span class="keywordtype">object</span>);};
<a name="l01855"></a>01855 
<a name="l01860"></a><a class="code" href="a00124.html#a6b6731b3d2ecd4e31879961addcdfa62">01860</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(T *<span class="keywordtype">object</span>)
<a name="l01861"></a>01861         {replace(<span class="keywordtype">object</span>);};
<a name="l01862"></a>01862 
<a name="l01867"></a><a class="code" href="a00124.html#a5811a7031c50edfbda34b2d177dd3749">01867</a>     <span class="keyword">inline</span> T *operator*()
<a name="l01868"></a>01868         {<span class="keywordflow">return</span> <a class="code" href="a00208.html#a8048c8716eafab6b193a59529650db5c" title="Convenience function to duplicate object pointer to heap.">dup</a>();};
<a name="l01869"></a>01869 };
<a name="l01870"></a>01870 
<a name="l01878"></a>01878 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01879"></a><a class="code" href="a00070.html">01879</a> <span class="keyword">class </span><a class="code" href="a00070.html" title="Templated locked pointer for referencing locked objects of specific type.">locked_pointer</a> : <span class="keyword">public</span> <a class="code" href="a00072.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>
<a name="l01880"></a>01880 {
<a name="l01881"></a>01881 <span class="keyword">public</span>:
<a name="l01885"></a><a class="code" href="a00070.html#a59f2c2db3f64f460973cb40f5bf42a5f">01885</a>     <span class="keyword">inline</span> <a class="code" href="a00070.html#a59f2c2db3f64f460973cb40f5bf42a5f" title="Create an instance of a typed locked pointer.">locked_pointer</a>() : <a class="code" href="a00072.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>() {};
<a name="l01886"></a>01886 
<a name="l01892"></a><a class="code" href="a00070.html#af7b03d55138605c133804ab754d1c1db">01892</a>     <span class="keyword">inline</span> T* <a class="code" href="a00208.html#a8048c8716eafab6b193a59529650db5c" title="Convenience function to duplicate object pointer to heap.">dup</a>(<span class="keywordtype">void</span>)
<a name="l01893"></a>01893         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T *<span class="keyword">&gt;</span>(<a class="code" href="a00208.html#a8048c8716eafab6b193a59529650db5c" title="Convenience function to duplicate object pointer to heap.">LockedPointer::dup</a>());};
<a name="l01894"></a>01894 
<a name="l01899"></a><a class="code" href="a00070.html#ac6cb3883ac4064eb4bb963baae6fbe2a">01899</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> replace(T *<span class="keywordtype">object</span>)
<a name="l01900"></a>01900         {LockedPointer::replace(<span class="keywordtype">object</span>);};
<a name="l01901"></a>01901 
<a name="l01906"></a><a class="code" href="a00070.html#aee989b368c40113be2b0743ad68bd5d0">01906</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(T *<span class="keywordtype">object</span>)
<a name="l01907"></a>01907         {replace(<span class="keywordtype">object</span>);};
<a name="l01908"></a>01908 
<a name="l01914"></a><a class="code" href="a00070.html#adfd627a4d783b856e3dc4c4b423f581f">01914</a>     <span class="keyword">inline</span> T *operator*()
<a name="l01915"></a>01915         {<span class="keywordflow">return</span> <a class="code" href="a00208.html#a8048c8716eafab6b193a59529650db5c" title="Convenience function to duplicate object pointer to heap.">dup</a>();};
<a name="l01916"></a>01916 };
<a name="l01917"></a>01917 
<a name="l01923"></a>01923 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01924"></a><a class="code" href="a00069.html">01924</a> <span class="keyword">class </span><a class="code" href="a00069.html" title="A templated smart pointer instance for lock protected objects.">locked_instance</a> : <span class="keyword">public</span> <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>
<a name="l01925"></a>01925 {
<a name="l01926"></a>01926 <span class="keyword">public</span>:
<a name="l01930"></a><a class="code" href="a00069.html#a8b43bfe6ef8d5447a774cff5361404b7">01930</a>     <span class="keyword">inline</span> <a class="code" href="a00069.html#a8b43bfe6ef8d5447a774cff5361404b7" title="Construct empty locked instance of typed object.">locked_instance</a>() : <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>() {};
<a name="l01931"></a>01931 
<a name="l01936"></a><a class="code" href="a00069.html#af0c2939664cbd793e4489c211bcff2b1">01936</a>     <span class="keyword">inline</span> <a class="code" href="a00069.html#af0c2939664cbd793e4489c211bcff2b1" title="Construct locked instance of typed object from matching locked_pointer.">locked_instance</a>(<a class="code" href="a00070.html" title="Templated locked pointer for referencing locked objects of specific type.">locked_pointer&lt;T&gt;</a> &amp;<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>) : <a class="code" href="a00071.html" title="Auto-pointer support class for locked objects.">locked_release</a>(pointer) {};
<a name="l01937"></a>01937 
<a name="l01942"></a><a class="code" href="a00069.html#a6bb31260e8e85dd25585ef5fb304bd93">01942</a>     <span class="keyword">inline</span> T&amp; operator*()<span class="keyword"> const</span>
<a name="l01943"></a>01943 <span class="keyword">        </span>{<span class="keywordflow">return</span> *(<span class="keyword">static_cast&lt;</span>T *<span class="keyword">&gt;</span>(object));};
<a name="l01944"></a>01944 
<a name="l01949"></a><a class="code" href="a00069.html#acfdfbbaf628d669bca7a797894d70a82">01949</a>     <span class="keyword">inline</span> T* operator-&gt;()<span class="keyword"> const</span>
<a name="l01950"></a>01950 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(object);};
<a name="l01951"></a>01951 
<a name="l01956"></a><a class="code" href="a00069.html#a86339bb2a52114d06e0a6dde55d8efcc">01956</a>     <span class="keyword">inline</span> T* <span class="keyword">get</span>(void) <span class="keyword">const</span>
<a name="l01957"></a>01957         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(object);};
<a name="l01958"></a>01958 };
<a name="l01959"></a>01959 
<a name="l01965"></a>01965 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01966"></a><a class="code" href="a00122.html">01966</a> <span class="keyword">class </span><a class="code" href="a00122.html" title="A templated smart pointer instance for shared singleton typed objects.">shared_instance</a> : <span class="keyword">public</span> <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>
<a name="l01967"></a>01967 {
<a name="l01968"></a>01968 <span class="keyword">public</span>:
<a name="l01972"></a><a class="code" href="a00122.html#abc615fb4082fad683c743b33e99a1fa1">01972</a>     <span class="keyword">inline</span> <a class="code" href="a00122.html#abc615fb4082fad683c743b33e99a1fa1" title="Construct empty instance to reference shared typed singleton.">shared_instance</a>() : <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>() {};
<a name="l01973"></a>01973 
<a name="l01979"></a><a class="code" href="a00122.html#a915610ab432bb7a603bb92f2de173668">01979</a>     <span class="keyword">inline</span> <a class="code" href="a00122.html#a915610ab432bb7a603bb92f2de173668" title="Construct shared access instance of shared typed singleton from matching shared_pointer...">shared_instance</a>(<a class="code" href="a00124.html" title="Templated shared pointer for singleton shared objects of specific type.">shared_pointer&lt;T&gt;</a> &amp;<a class="code" href="a00110.html" title="Generic smart pointer class.">pointer</a>) : <a class="code" href="a00125.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>(pointer) {};
<a name="l01980"></a>01980 
<a name="l01984"></a><a class="code" href="a00122.html#a3e5132ebee652e5d71b60f0cf625ba66">01984</a>     <span class="keyword">inline</span> <span class="keyword">const</span> T&amp; operator*()<span class="keyword"> const</span>
<a name="l01985"></a>01985 <span class="keyword">        </span>{<span class="keywordflow">return</span> *(<span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T *<span class="keyword">&gt;</span>(ptr-&gt;pointer));};
<a name="l01986"></a>01986 
<a name="l01991"></a><a class="code" href="a00122.html#a7f0705896baf3609fa84e9fbc062da6f">01991</a>     <span class="keyword">inline</span> <span class="keyword">const</span> T* operator-&gt;()<span class="keyword"> const</span>
<a name="l01992"></a>01992 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(ptr-&gt;pointer);};
<a name="l01993"></a>01993 
<a name="l01998"></a><a class="code" href="a00122.html#a5ba66bad76ebd68d863e0d9fd69ebfd8">01998</a>     <span class="keyword">inline</span> <span class="keyword">const</span> T* <span class="keyword">get</span>(void) <span class="keyword">const</span>
<a name="l01999"></a>01999         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keyword">const </span>T*<span class="keyword">&gt;</span>(ptr-&gt;pointer);};
<a name="l02000"></a>02000 };
<a name="l02001"></a>02001 
<a name="l02008"></a>02008 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l02009"></a><a class="code" href="a00088.html">02009</a> <span class="keyword">class </span><a class="code" href="a00088.html" title="Typed smart locked pointer class.">mutex_pointer</a> : <span class="keyword">public</span> <a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>
<a name="l02010"></a>02010 {
<a name="l02011"></a>02011 <span class="keyword">public</span>:
<a name="l02015"></a><a class="code" href="a00088.html#a0b44354f1a27542167cd3f7d6b29c599">02015</a>     <span class="keyword">inline</span> <a class="code" href="a00088.html#a0b44354f1a27542167cd3f7d6b29c599" title="Create a pointer with no reference.">mutex_pointer</a>() : <a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>() {};
<a name="l02016"></a>02016 
<a name="l02021"></a><a class="code" href="a00088.html#a65881941ef2b1bf4fb4de7eecac549e9">02021</a>     <span class="keyword">inline</span> <a class="code" href="a00088.html#a65881941ef2b1bf4fb4de7eecac549e9" title="Create a pointer with a reference to a heap object.">mutex_pointer</a>(T* <span class="keywordtype">object</span>) : <a class="code" href="a00022.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>(object) {};
<a name="l02022"></a>02022 
<a name="l02027"></a><a class="code" href="a00088.html#a56f4f4071fcd9fff414c38bf64e6a343">02027</a>     <span class="keyword">inline</span> T&amp; operator*()<span class="keyword"> const</span>
<a name="l02028"></a>02028 <span class="keyword">        </span>{<span class="keywordflow">return</span> *(<span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(auto_protect::object));};
<a name="l02029"></a>02029 
<a name="l02034"></a><a class="code" href="a00088.html#aa729c81295dd9b0d5c3653faa3f9298a">02034</a>     <span class="keyword">inline</span> T* operator-&gt;()<span class="keyword"> const</span>
<a name="l02035"></a>02035 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(auto_protect::object);};
<a name="l02036"></a>02036 
<a name="l02041"></a><a class="code" href="a00088.html#a66cde8fab242a2cac2cdb95eebcf41ac">02041</a>     <span class="keyword">inline</span> T* <span class="keyword">get</span>(void) <span class="keyword">const</span>
<a name="l02042"></a>02042         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(auto_protect::object);};
<a name="l02043"></a>02043 };
<a name="l02044"></a>02044 
<a name="l02050"></a><a class="code" href="a00208.html#a3c62610106837fc4ebbe70e9001bdb2f">02050</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c62610106837fc4ebbe70e9001bdb2f" title="Convenience function to start a joinable thread.">start</a>(<a class="code" href="a00053.html" title="A child thread object that may be joined by parent.">JoinableThread</a> *thread, <span class="keywordtype">int</span> priority = 0)
<a name="l02051"></a>02051     {thread-&gt;<a class="code" href="a00053.html#a87db5eaad6e8f35c6d9881308b063439" title="Start execution of child context.">start</a>(priority);}
<a name="l02052"></a>02052 
<a name="l02058"></a><a class="code" href="a00208.html#ad9c387d81bbd692673cb269301fa0977">02058</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c62610106837fc4ebbe70e9001bdb2f" title="Convenience function to start a joinable thread.">start</a>(<a class="code" href="a00045.html" title="A detached thread object that is stand-alone.">DetachedThread</a> *thread, <span class="keywordtype">int</span> priority = 0)
<a name="l02059"></a>02059     {thread-&gt;<a class="code" href="a00045.html#a55bee7740e411af3dcf6cc9472813e9e" title="Start execution of detached context.">start</a>(priority);}
<a name="l02060"></a>02060 
<a name="l02064"></a><a class="code" href="a00208.html#abebfc4fdbd3f121384e37dec22d81a99">02064</a> <span class="keyword">typedef</span> <a class="code" href="a00038.html" title="An optimized and convertable shared lock.">ConditionalLock</a> <a class="code" href="a00038.html" title="An optimized and convertable shared lock.">condlock_t</a>;
<a name="l02065"></a>02065 
<a name="l02069"></a><a class="code" href="a00208.html#a3c7870419a69d08ac512ca90b2ee5c30">02069</a> <span class="keyword">typedef</span> <a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a> <a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a>;
<a name="l02070"></a>02070 
<a name="l02074"></a><a class="code" href="a00208.html#ae8d4cd555819dc808ebaba1399fc1ef4">02074</a> <span class="keyword">typedef</span> <a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a> <a class="code" href="a00161.html" title="Event notification to manage scheduled realtime threads.">timedevent_t</a>;
<a name="l02075"></a>02075 
<a name="l02079"></a><a class="code" href="a00208.html#a2398d6ff8eba53501c5c9f9546a460bb">02079</a> <span class="keyword">typedef</span> <a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">Mutex</a> <a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">mutex_t</a>;
<a name="l02080"></a>02080 
<a name="l02084"></a><a class="code" href="a00208.html#a7e3cf59c308d4010952a23e8a98e7053">02084</a> <span class="keyword">typedef</span> <a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">ThreadLock</a> <a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">rwlock_t</a>;
<a name="l02085"></a>02085 
<a name="l02089"></a><a class="code" href="a00208.html#afec4835fd37bc545b7d94b1c6e418846">02089</a> <span class="keyword">typedef</span> <a class="code" href="a00114.html" title="Portable recursive exclusive lock.">RecursiveMutex</a> <a class="code" href="a00114.html" title="Portable recursive exclusive lock.">rexlock_t</a>;
<a name="l02090"></a>02090 
<a name="l02094"></a><a class="code" href="a00208.html#a3ee7dd630e73f3ed67f1832535ccb6c4">02094</a> <span class="keyword">typedef</span> <a class="code" href="a00119.html" title="A portable counting semaphore class.">Semaphore</a> <a class="code" href="a00119.html" title="A portable counting semaphore class.">semaphore_t</a>;
<a name="l02095"></a>02095 
<a name="l02099"></a><a class="code" href="a00208.html#ab4765976f498ecdf872d4984bafb681c">02099</a> <span class="keyword">typedef</span> <a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a> <a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier_t</a>;
<a name="l02100"></a>02100 
<a name="l02105"></a><a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5">02105</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier_t</a> &amp;<a class="code" href="a00024.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>)
<a name="l02106"></a>02106     {barrier.<a class="code" href="a00024.html#abac6db6b75abd87d2cf515dd55a40625" title="Wait at the barrier until the count of threads waiting is reached.">wait</a>();}
<a name="l02107"></a>02107 
<a name="l02113"></a><a class="code" href="a00208.html#a333b7825bb02a3a0429e8c2153b130b2">02113</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5c50c87fd1eb5b1ac93dffa0ee6f9af5" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00119.html" title="A portable counting semaphore class.">semaphore_t</a> &amp;semaphore, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf)
<a name="l02114"></a>02114     {semaphore.<a class="code" href="a00119.html#acd81d0597579f11e7302467f8e1a1a17" title="Wait until the semphore usage count is less than the thread limit.">wait</a>(timeout);}
<a name="l02115"></a>02115 
<a name="l02120"></a><a class="code" href="a00208.html#ab40408ee1a0ecade11a865036007ed80">02120</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00119.html" title="A portable counting semaphore class.">semaphore_t</a> &amp;semaphore)
<a name="l02121"></a>02121     {semaphore.<a class="code" href="a00119.html#ab75f833b69046a147260881d3cc51415" title="Release the semaphore after waiting for it.">release</a>();}
<a name="l02122"></a>02122 
<a name="l02127"></a><a class="code" href="a00208.html#a3c813dcccc3a9eec6a0da47efcac7a1f">02127</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a3c813dcccc3a9eec6a0da47efcac7a1f" title="Convenience function to acquire a mutex.">acquire</a>(<a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">mutex_t</a> &amp;mutex)
<a name="l02128"></a>02128     {mutex.<a class="code" href="a00086.html#adac15f4646a7dc0bef489f9179771d0f" title="Acquire mutex lock.">lock</a>();}
<a name="l02129"></a>02129 
<a name="l02134"></a><a class="code" href="a00208.html#adad46d50a99361486daa6c298d1a2d21">02134</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00086.html" title="Generic non-recursive exclusive lock class.">mutex_t</a> &amp;mutex)
<a name="l02135"></a>02135     {mutex.<a class="code" href="a00086.html#aa8e309c56ee0ff9f2d463b82c2e20030" title="Release acquired lock.">release</a>();}
<a name="l02136"></a>02136 
<a name="l02141"></a><a class="code" href="a00208.html#a7bbf6bb584edfaa7d0cf79c1312ea26f">02141</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a7bbf6bb584edfaa7d0cf79c1312ea26f" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02142"></a>02142     {lock.<a class="code" href="a00037.html#a69bb754c052d0915defd46d96e346a7c" title="Exclusive mode write thread scheduling.">modify</a>();}
<a name="l02143"></a>02143 
<a name="l02148"></a><a class="code" href="a00208.html#ae8014d7a484399e83e7a3f66a0d34a66">02148</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5422fe5f7269f2606c8317e29e4147bf" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02149"></a>02149     {lock.<a class="code" href="a00037.html#a0e45df81148cfcb5cc2e197dc751972b" title="Access mode shared thread scheduling.">access</a>();}
<a name="l02150"></a>02150 
<a name="l02155"></a><a class="code" href="a00208.html#a1e5c8030c3c086e9fa9d4116092da607">02155</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02156"></a>02156     {lock.<a class="code" href="a00037.html#a3a5a54da9274122f0d944f820eb1a806" title="Release access mode read scheduling.">release</a>();}
<a name="l02157"></a>02157 
<a name="l02163"></a><a class="code" href="a00208.html#af77af9c36e881ef569e2fb1bf5dca1d6">02163</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#af77af9c36e881ef569e2fb1bf5dca1d6" title="Convenience function to commit an exclusive access lock.">commit</a>(<a class="code" href="a00037.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02164"></a>02164     {lock.<a class="code" href="a00037.html#a7555ff21951000954a00355ceaf32bb3" title="Complete exclusive mode write scheduling.">commit</a>();}
<a name="l02165"></a>02165 
<a name="l02170"></a><a class="code" href="a00208.html#a54b291a8e54c576e4e67c6fd04733089">02170</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a38f16b6c76465ba13751ff3b5be4a41e" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02171"></a>02171     {lock.<a class="code" href="a00038.html#a719bfdd193be78ad51d5b034822fbb2f" title="Convert read lock into exclusive (write/modify) access.">exclusive</a>();}
<a name="l02172"></a>02172 
<a name="l02177"></a><a class="code" href="a00208.html#a2a6157c301532362884a18c25c098c52">02177</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#aa738a981d717c379a3facda88eafbdea" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol...">share</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02178"></a>02178     {lock.<a class="code" href="a00038.html#a93aa50cae673c104a3436940de1e63b8" title="Return an exclusive access lock back to share mode.">share</a>();}
<a name="l02179"></a>02179 
<a name="l02184"></a><a class="code" href="a00208.html#ae7473d2a2c893387d5f6046486c46b5a">02184</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a7bbf6bb584edfaa7d0cf79c1312ea26f" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02185"></a>02185     {lock.<a class="code" href="a00038.html#a3d3a37cc1d24d1326deb9755ce0f6171" title="Acquire write (exclusive modify) lock.">modify</a>();}
<a name="l02186"></a>02186 
<a name="l02192"></a><a class="code" href="a00208.html#ac9f6f0089b3169e2d79bbf0c7777e6e5">02192</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#af77af9c36e881ef569e2fb1bf5dca1d6" title="Convenience function to commit an exclusive access lock.">commit</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02193"></a>02193     {lock.<a class="code" href="a00038.html#aa8b1287c294c8abc9c30000e9d5b9052" title="Commit changes / release a modify lock.">commit</a>();}
<a name="l02194"></a>02194 
<a name="l02199"></a><a class="code" href="a00208.html#ae40e9a29f3fd228b50f046f7d428eb6a">02199</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a5422fe5f7269f2606c8317e29e4147bf" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02200"></a>02200     {lock.<a class="code" href="a00038.html#a6c50babda6e4c056be90b754738d2d5d" title="Acquire access (shared read) lock.">access</a>();}
<a name="l02201"></a>02201 
<a name="l02206"></a><a class="code" href="a00208.html#a171f36a021804ce628a3da7f2c19c7b6">02206</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00038.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02207"></a>02207     {lock.<a class="code" href="a00038.html#ae9a0b040d4d65870ac7d67d2b96cea50" title="Release a shared lock.">release</a>();}
<a name="l02208"></a>02208 
<a name="l02214"></a><a class="code" href="a00208.html#a7b0d2beefd1454719db2b26aebdf3f61">02214</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00208.html#a38f16b6c76465ba13751ff3b5be4a41e" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">rwlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf)
<a name="l02215"></a>02215     {<span class="keywordflow">return</span> lock.<a class="code" href="a00157.html#a1bf92873e3b21e95702691d04a740bd2" title="Request modify (write) access through the lock.">modify</a>(timeout);}
<a name="l02216"></a>02216 
<a name="l02222"></a><a class="code" href="a00208.html#ae8121584dc72d5d51403c61aa4d3873f">02222</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00208.html#aa738a981d717c379a3facda88eafbdea" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol...">share</a>(<a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">rwlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = Timer::inf)
<a name="l02223"></a>02223     {<span class="keywordflow">return</span> lock.<a class="code" href="a00157.html#a6809ba3a3e992cdd9f7688b4d9d52bb1" title="Request shared (read) access through the lock.">access</a>(timeout);}
<a name="l02224"></a>02224 
<a name="l02229"></a><a class="code" href="a00208.html#af250e8f47c069f733f78cf73855e45e6">02229</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00157.html" title="A generic and portable implimentation of Read/Write locking.">rwlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02230"></a>02230     {lock.<a class="code" href="a00157.html#adc28816b8692681307f59e29686402ec" title="Release an arbitrary object that has been protected by a rwlock.">release</a>();}
<a name="l02231"></a>02231 
<a name="l02236"></a><a class="code" href="a00208.html#a193c654e8874e1039646f9f981c4785e">02236</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<a class="code" href="a00114.html" title="Portable recursive exclusive lock.">rexlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02237"></a>02237     {lock.<a class="code" href="a00114.html#ad5b50251914d7eaeb73f0075ec466d41" title="Acquire or increase locking.">lock</a>();}
<a name="l02238"></a>02238 
<a name="l02243"></a><a class="code" href="a00208.html#ae9c42524f9bed49eb0da7a443c36d1aa">02243</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00114.html" title="Portable recursive exclusive lock.">rexlock_t</a> &amp;<a class="code" href="a00208.html#a93b9eec9d0b7db95ce778265f806afd6" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02244"></a>02244     {lock.<a class="code" href="a00114.html#aa56322f581c331e7f15049a0a9ecf3e9" title="Release or decrease locking.">release</a>();}
<a name="l02245"></a>02245 
<a name="l02246"></a>02246 END_NAMESPACE
<a name="l02247"></a>02247 
<a name="l02248"></a>02248 <span class="preprocessor">#define ENTER_EXCLUSIVE \</span>
<a name="l02249"></a>02249 <span class="preprocessor">    do { static pthread_mutex_t __sync__ = PTHREAD_MUTEX_INITIALIZER; \</span>
<a name="l02250"></a>02250 <span class="preprocessor">        pthread_mutex_lock(&amp;__sync__);</span>
<a name="l02251"></a>02251 <span class="preprocessor"></span>
<a name="l02252"></a>02252 <span class="preprocessor">#define LEAVE_EXCLUSIVE \</span>
<a name="l02253"></a>02253 <span class="preprocessor">    pthread_mutex_unlock(&amp;__sync__);} while(0);</span>
<a name="l02254"></a>02254 <span class="preprocessor"></span>
<a name="l02255"></a>02255 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 16:38:57 2011 for ucommon by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>