Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > 64656f00434e190abe8506174ca339ed > files > 857

ucommon-doc-4.3.1-1.mga1.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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ucommon</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00200.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>ucommon/thread.h</h1>  </div>
</div>
<div class="contents">
<a href="a00200.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;ucommon/platform.h&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;ucommon/access.h&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;ucommon/timers.h&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;ucommon/memory.h&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><a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>;
<a name="l00075"></a>00075 
<a name="l00086"></a><a class="code" href="a00034.html">00086</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00034.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="a00035.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">#ifdef  _MSWINDOWS_</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span>    <span class="keyword">enum</span> {SIGNAL = 0, BROADCAST = 1};
<a name="l00093"></a>00093     HANDLE events[2];
<a name="l00094"></a>00094     <span class="keywordtype">unsigned</span> waiting;
<a name="l00095"></a>00095     CRITICAL_SECTION mlock;
<a name="l00096"></a>00096     CRITICAL_SECTION <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>;
<a name="l00097"></a>00097 <span class="preprocessor">#else</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#ifndef __PTH__</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span>    <span class="keyword">class </span>__LOCAL attribute
<a name="l00100"></a>00100     {
<a name="l00101"></a>00101     <span class="keyword">public</span>:
<a name="l00102"></a>00102         pthread_condattr_t attr;
<a name="l00103"></a>00103         attribute();
<a name="l00104"></a>00104     };
<a name="l00105"></a>00105 
<a name="l00106"></a>00106     __LOCAL <span class="keyword">static</span> attribute attr;
<a name="l00107"></a>00107 <span class="preprocessor">#endif</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span>
<a name="l00109"></a>00109     pthread_cond_t cond;
<a name="l00110"></a>00110     pthread_mutex_t <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>;
<a name="l00111"></a>00111 <span class="preprocessor">#endif</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
<a name="l00113"></a>00113 <span class="keyword">protected</span>:
<a name="l00114"></a>00114     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>;
<a name="l00115"></a>00115 
<a name="l00121"></a>00121     <span class="keywordtype">bool</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00122"></a>00122 
<a name="l00128"></a>00128     <span class="keywordtype">bool</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<span class="keyword">struct</span> timespec *timeout);
<a name="l00129"></a>00129 
<a name="l00130"></a>00130 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00132"></a>00132         {EnterCriticalSection(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00133"></a>00133 
<a name="l00134"></a>00134     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a1c26a3ce6612b64ea0eeced9deaad61f" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00135"></a>00135         {LeaveCriticalSection(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     <span class="keywordtype">void</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<span class="keywordtype">void</span>);
<a name="l00138"></a>00138     <span class="keywordtype">void</span> <a class="code" href="a00160.html#a95851ef41dc31eed512cbecc2bc8e984" title="Signal pending event.">signal</a>(<span class="keywordtype">void</span>);
<a name="l00139"></a>00139     <span class="keywordtype">void</span> broadcast(<span class="keywordtype">void</span>);
<a name="l00140"></a>00140 
<a name="l00141"></a>00141 <span class="preprocessor">#else</span>
<a name="l00142"></a>00142 <span class="preprocessor"></span>
<a name="l00145"></a><a class="code" href="a00034.html#aaff601cf11741a4ea7f46a5ebc0dc577">00145</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00146"></a>00146         {pthread_mutex_lock(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00147"></a>00147 
<a name="l00151"></a><a class="code" href="a00034.html#a2625eac2b82009b262df563dcc5756a4">00151</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a1c26a3ce6612b64ea0eeced9deaad61f" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00152"></a>00152         {pthread_mutex_unlock(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00153"></a>00153 
<a name="l00157"></a><a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8">00157</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<span class="keywordtype">void</span>)
<a name="l00158"></a>00158         {pthread_cond_wait(&amp;cond, &amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00159"></a>00159 
<a name="l00163"></a><a class="code" href="a00034.html#a5bd3775fd39e644bab2dbdfacb99d489">00163</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00160.html#a95851ef41dc31eed512cbecc2bc8e984" title="Signal pending event.">signal</a>(<span class="keywordtype">void</span>)
<a name="l00164"></a>00164         {pthread_cond_signal(&amp;cond);};
<a name="l00165"></a>00165 
<a name="l00169"></a><a class="code" href="a00034.html#a17da86ba179a184a37d6fd9b834df880">00169</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> broadcast(<span class="keywordtype">void</span>)
<a name="l00170"></a>00170         {pthread_cond_broadcast(&amp;cond);};
<a name="l00171"></a>00171 <span class="preprocessor">#endif</span>
<a name="l00172"></a>00172 <span class="preprocessor"></span>
<a name="l00176"></a>00176     <a class="code" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>();
<a name="l00177"></a>00177 
<a name="l00181"></a>00181     ~<a class="code" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>();
<a name="l00182"></a>00182 
<a name="l00183"></a>00183 <span class="keyword">public</span>:
<a name="l00184"></a>00184 <span class="preprocessor">#if !defined(_MSWINDOWS_) &amp;&amp; !defined(__PTH__)</span>
<a name="l00185"></a>00185 <span class="preprocessor"></span>
<a name="l00190"></a><a class="code" href="a00034.html#a2f5acd04f41d46f35118184b466b614a">00190</a>     <span class="keyword">static</span> <span class="keyword">inline</span> pthread_condattr_t *initializer(<span class="keywordtype">void</span>)
<a name="l00191"></a>00191         {<span class="keywordflow">return</span> &amp;attr.attr;};
<a name="l00192"></a>00192 <span class="preprocessor">#endif</span>
<a name="l00193"></a>00193 <span class="preprocessor"></span>
<a name="l00200"></a>00200     <span class="keyword">static</span> <span class="keywordtype">void</span> gettimeout(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout, <span class="keyword">struct</span> timespec *hires);
<a name="l00201"></a>00201 };
<a name="l00202"></a>00202 
<a name="l00210"></a><a class="code" href="a00035.html">00210</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a> : <span class="keyword">private</span> <a class="code" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l00211"></a>00211 {
<a name="l00212"></a>00212 <span class="keyword">private</span>:
<a name="l00213"></a>00213 <span class="preprocessor">#ifndef _MSWINDOWS_</span>
<a name="l00214"></a>00214 <span class="preprocessor"></span>    pthread_cond_t bcast;
<a name="l00215"></a>00215 <span class="preprocessor">#endif</span>
<a name="l00216"></a>00216 <span class="preprocessor"></span>
<a name="l00217"></a>00217 <span class="keyword">protected</span>:
<a name="l00218"></a>00218     <span class="keywordtype">unsigned</span> pending, waiting, sharing;
<a name="l00219"></a>00219 
<a name="l00225"></a>00225     <span class="keywordtype">bool</span> waitSignal(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00226"></a>00226 
<a name="l00232"></a>00232     <span class="keywordtype">bool</span> waitBroadcast(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00233"></a>00233 
<a name="l00234"></a>00234 
<a name="l00240"></a>00240     <span class="keywordtype">bool</span> waitSignal(<span class="keyword">struct</span> timespec *timeout);
<a name="l00241"></a>00241 
<a name="l00247"></a>00247     <span class="keywordtype">bool</span> waitBroadcast(<span class="keyword">struct</span> timespec *timeout);
<a name="l00248"></a>00248 
<a name="l00255"></a><a class="code" href="a00035.html#abcbe36aff9866dd3104abade7e1783a9">00255</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#af4a2bd33fe0e25ba29e2b014991a3b7d" title="Convert a millisecond timeout into use for high resolution conditional timers.">gettimeout</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout, <span class="keyword">struct</span> timespec *hires)
<a name="l00256"></a>00256         {<a class="code" href="a00034.html#af4a2bd33fe0e25ba29e2b014991a3b7d" title="Convert a millisecond timeout into use for high resolution conditional timers.">Conditional::gettimeout</a>(timeout, hires);};
<a name="l00257"></a>00257 
<a name="l00258"></a>00258 
<a name="l00259"></a>00259 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l00260"></a>00260 <span class="preprocessor"></span>    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#aaff601cf11741a4ea7f46a5ebc0dc577" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00261"></a>00261         {EnterCriticalSection(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00262"></a>00262 
<a name="l00263"></a>00263     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#a2625eac2b82009b262df563dcc5756a4" title="Unlock the conditional&amp;#39;s supporting mutex.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00264"></a>00264         {LeaveCriticalSection(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00265"></a>00265 
<a name="l00266"></a>00266     <span class="keywordtype">void</span> waitSignal(<span class="keywordtype">void</span>);
<a name="l00267"></a>00267     <span class="keywordtype">void</span> waitBroadcast(<span class="keywordtype">void</span>);
<a name="l00268"></a>00268 
<a name="l00269"></a>00269     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#a5bd3775fd39e644bab2dbdfacb99d489" title="Signal the conditional to release one waiting thread.">signal</a>(<span class="keywordtype">void</span>)
<a name="l00270"></a>00270         {<a class="code" href="a00034.html#a5bd3775fd39e644bab2dbdfacb99d489" title="Signal the conditional to release one waiting thread.">Conditional::signal</a>();};
<a name="l00271"></a>00271 
<a name="l00272"></a>00272     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#a17da86ba179a184a37d6fd9b834df880" title="Signal the conditional to release all waiting threads.">broadcast</a>(<span class="keywordtype">void</span>)
<a name="l00273"></a>00273         {<a class="code" href="a00034.html#a17da86ba179a184a37d6fd9b834df880" title="Signal the conditional to release all waiting threads.">Conditional::broadcast</a>();};
<a name="l00274"></a>00274 
<a name="l00275"></a>00275 <span class="preprocessor">#else</span>
<a name="l00276"></a>00276 <span class="preprocessor"></span>
<a name="l00279"></a><a class="code" href="a00035.html#a700fa26d6f658e6e35847f8271082e70">00279</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#aaff601cf11741a4ea7f46a5ebc0dc577" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<span class="keywordtype">void</span>)
<a name="l00280"></a>00280         {pthread_mutex_lock(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00281"></a>00281 
<a name="l00285"></a><a class="code" href="a00035.html#a51c86cd1ba14fedfc2856d0cc020db15">00285</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#a2625eac2b82009b262df563dcc5756a4" title="Unlock the conditional&amp;#39;s supporting mutex.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l00286"></a>00286         {pthread_mutex_unlock(&amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00287"></a>00287 
<a name="l00291"></a><a class="code" href="a00035.html#a2fed6958c093864e2edfe20474dbc2dc">00291</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> waitSignal(<span class="keywordtype">void</span>)
<a name="l00292"></a>00292         {pthread_cond_wait(&amp;cond, &amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00293"></a>00293 
<a name="l00297"></a><a class="code" href="a00035.html#aebc127ed615e466e3ac382ee9aeb053c">00297</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> waitBroadcast(<span class="keywordtype">void</span>)
<a name="l00298"></a>00298         {pthread_cond_wait(&amp;bcast, &amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>);};
<a name="l00299"></a>00299 
<a name="l00300"></a>00300 
<a name="l00304"></a><a class="code" href="a00035.html#a75be8dc8122a8704fe642bc5b55ec6d2">00304</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#a5bd3775fd39e644bab2dbdfacb99d489" title="Signal the conditional to release one waiting thread.">signal</a>(<span class="keywordtype">void</span>)
<a name="l00305"></a>00305         {pthread_cond_signal(&amp;cond);};
<a name="l00306"></a>00306 
<a name="l00310"></a><a class="code" href="a00035.html#aab41b548c6e7761c05f6b2a33019fdbe">00310</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#a17da86ba179a184a37d6fd9b834df880" title="Signal the conditional to release all waiting threads.">broadcast</a>(<span class="keywordtype">void</span>)
<a name="l00311"></a>00311         {pthread_cond_broadcast(&amp;bcast);};
<a name="l00312"></a>00312 <span class="preprocessor">#endif</span>
<a name="l00313"></a>00313 <span class="preprocessor"></span><span class="keyword">public</span>:
<a name="l00317"></a>00317     <a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>();
<a name="l00318"></a>00318 
<a name="l00322"></a>00322     ~<a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>();
<a name="l00323"></a>00323 
<a name="l00327"></a>00327     <span class="keywordtype">void</span> <a class="code" href="a00176.html#af11d6983ce975637031c6eaa0b8cf621" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<span class="keywordtype">void</span>);
<a name="l00328"></a>00328 
<a name="l00332"></a>00332     <span class="keywordtype">void</span> <a class="code" href="a00200.html#aaaeabbd959a07e91ff1e0bfabf25f600" title="Convenience function to exclusively schedule conditional access.">modify</a>(<span class="keywordtype">void</span>);
<a name="l00333"></a>00333 
<a name="l00337"></a>00337     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00338"></a>00338 
<a name="l00342"></a>00342     <span class="keywordtype">void</span> <a class="code" href="a00200.html#a1cba76e7b293fb1dd2a1606a7d24a125" title="Convenience function to commit an exclusive access lock.">commit</a>(<span class="keywordtype">void</span>);
<a name="l00343"></a>00343 
<a name="l00350"></a>00350     <span class="keywordtype">void</span> limit_sharing(<span class="keywordtype">unsigned</span> <a class="code" href="a00185.html#afc341c1b5f236384143a01495b99cd26" title="Convenience function to return max of two objects.">max</a>);
<a name="l00351"></a>00351 };
<a name="l00352"></a>00352 
<a name="l00361"></a><a class="code" href="a00160.html">00361</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a> : <span class="keyword">public</span> <a class="code" href="a00161.html" title="Timer class to use when scheduling realtime events.">Timer</a>
<a name="l00362"></a>00362 {
<a name="l00363"></a>00363 <span class="keyword">private</span>:
<a name="l00364"></a>00364 <span class="preprocessor">#ifdef _MSWINDOWS_</span>
<a name="l00365"></a>00365 <span class="preprocessor"></span>    HANDLE event;
<a name="l00366"></a>00366 <span class="preprocessor">#else</span>
<a name="l00367"></a>00367 <span class="preprocessor"></span>    pthread_cond_t cond;
<a name="l00368"></a>00368     <span class="keywordtype">bool</span> signalled;
<a name="l00369"></a>00369 <span class="preprocessor">#endif</span>
<a name="l00370"></a>00370 <span class="preprocessor"></span>    pthread_mutex_t <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>;
<a name="l00371"></a>00371 
<a name="l00372"></a>00372 <span class="keyword">protected</span>:
<a name="l00377"></a>00377     <span class="keywordtype">void</span> <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>);
<a name="l00378"></a>00378 
<a name="l00383"></a>00383     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00384"></a>00384 
<a name="l00392"></a>00392     <span class="keywordtype">bool</span> <a class="code" href="a00161.html#a7301c16851c49cb223fbbe7ae016cb2b" title="Sleep current thread until the specified timer expires.">sync</a>(<span class="keywordtype">void</span>);
<a name="l00393"></a>00393 
<a name="l00394"></a>00394 <span class="keyword">public</span>:
<a name="l00398"></a>00398     <a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>(<span class="keywordtype">void</span>);
<a name="l00399"></a>00399 
<a name="l00404"></a>00404     <a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00405"></a>00405 
<a name="l00410"></a>00410     <a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>(time_t timeout);
<a name="l00411"></a>00411 
<a name="l00415"></a>00415     ~<a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>();
<a name="l00416"></a>00416 
<a name="l00422"></a>00422     <span class="keywordtype">void</span> signal(<span class="keywordtype">void</span>);
<a name="l00423"></a>00423 
<a name="l00430"></a>00430     <span class="keywordtype">bool</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00431"></a>00431 
<a name="l00435"></a>00435     <span class="keywordtype">void</span> <a class="code" href="a00161.html#aa472fbf271860b78b4ae6f4b2099a3c1" title="A value to use when resetting.">reset</a>(<span class="keywordtype">void</span>);
<a name="l00436"></a>00436 
<a name="l00441"></a><a class="code" href="a00160.html#a2f0bc8fced98b803e4ab2f5925212130">00441</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> signal(<a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>&amp; timed)
<a name="l00442"></a>00442         {timed.<a class="code" href="a00160.html#a95851ef41dc31eed512cbecc2bc8e984" title="Signal pending event.">signal</a>();};
<a name="l00443"></a>00443 
<a name="l00448"></a><a class="code" href="a00160.html#a7f543d92f961e61a5bf29014504ded47">00448</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00161.html#aa472fbf271860b78b4ae6f4b2099a3c1" title="A value to use when resetting.">reset</a>(<a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>&amp; timed)
<a name="l00449"></a>00449         {timed.<a class="code" href="a00160.html#a5bffb9b3a06841465ece9eaf00c517be" title="Reset triggered conditional.">reset</a>();};
<a name="l00450"></a>00450 
<a name="l00457"></a><a class="code" href="a00160.html#aab6ea4806a06765b7cb3d2685861186f">00457</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a>&amp; timed, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l00458"></a>00458         {<span class="keywordflow">return</span> timed.<a class="code" href="a00160.html#a6bf4e6c551a8945f7814916a49266f2f" title="Wait to be signalled or until timer expires.">wait</a>(timeout);};
<a name="l00459"></a>00459 };
<a name="l00460"></a>00460 
<a name="l00468"></a><a class="code" href="a00114.html">00468</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00114.html" title="Portable recursive exclusive lock.">rexlock</a> : <span class="keyword">private</span> <a class="code" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>, <span class="keyword">public</span> <a class="code" href="a00046.html" title="An exclusive locking protocol interface base.">Exclusive</a>
<a name="l00469"></a>00469 {
<a name="l00470"></a>00470 <span class="keyword">private</span>:
<a name="l00471"></a>00471     <span class="keywordtype">unsigned</span> waiting;
<a name="l00472"></a>00472     <span class="keywordtype">unsigned</span> lockers;
<a name="l00473"></a>00473     pthread_t locker;
<a name="l00474"></a>00474 
<a name="l00475"></a>00475     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00046.html#accddc12c1829bda27c53704460f65dbc" title="Protocol interface to exclusive lock the object.">Exlock</a>(<span class="keywordtype">void</span>);
<a name="l00476"></a>00476     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00046.html#a7fedd71fdd18b502b560a2d85eb55134" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l00477"></a>00477 
<a name="l00478"></a>00478 <span class="keyword">public</span>:
<a name="l00482"></a>00482     <a class="code" href="a00114.html" title="Portable recursive exclusive lock.">rexlock</a>();
<a name="l00483"></a>00483 
<a name="l00487"></a>00487     <span class="keywordtype">void</span> <a class="code" href="a00034.html#aaff601cf11741a4ea7f46a5ebc0dc577" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<span class="keywordtype">void</span>);
<a name="l00488"></a>00488 
<a name="l00492"></a>00492     <span class="keywordtype">bool</span> <a class="code" href="a00034.html#aaff601cf11741a4ea7f46a5ebc0dc577" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00493"></a>00493 
<a name="l00497"></a>00497     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00498"></a>00498 
<a name="l00503"></a>00503     <span class="keywordtype">unsigned</span> getLocking(<span class="keywordtype">void</span>);
<a name="l00504"></a>00504 
<a name="l00509"></a>00509     <span class="keywordtype">unsigned</span> getWaiting(<span class="keywordtype">void</span>);
<a name="l00510"></a>00510 
<a name="l00515"></a><a class="code" href="a00114.html#a6679b04543d191afe65faa989c14f6d0">00515</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#aaff601cf11741a4ea7f46a5ebc0dc577" title="Lock the conditional&amp;#39;s supporting mutex.">lock</a>(<a class="code" href="a00114.html" title="Portable recursive exclusive lock.">rexlock</a>&amp; rex)
<a name="l00516"></a>00516         {rex.<a class="code" href="a00114.html#a9456447d47799fd2204c4f99dc772fb8" title="Acquire or increase locking.">lock</a>();};
<a name="l00517"></a>00517 
<a name="l00522"></a><a class="code" href="a00114.html#a4441782ad4bd62f67857784c1acf02fa">00522</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" 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</a>&amp; rex)
<a name="l00523"></a>00523         {rex.<a class="code" href="a00114.html#aa5eeed602dcb295a59737d4c5269c903" title="Release or decrease locking.">release</a>();};
<a name="l00524"></a>00524 };
<a name="l00525"></a>00525 
<a name="l00538"></a><a class="code" href="a00115.html">00538</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock</a> : <span class="keyword">private</span> <a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>, <span class="keyword">public</span> <a class="code" href="a00046.html" title="An exclusive locking protocol interface base.">Exclusive</a>, <span class="keyword">public</span> <a class="code" href="a00123.html" title="An exclusive locking protocol interface base.">Shared</a>
<a name="l00539"></a>00539 {
<a name="l00540"></a>00540 <span class="keyword">private</span>:
<a name="l00541"></a>00541     <span class="keywordtype">unsigned</span> writers;
<a name="l00542"></a>00542     pthread_t writeid;
<a name="l00543"></a>00543 
<a name="l00544"></a>00544     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00046.html#accddc12c1829bda27c53704460f65dbc" title="Protocol interface to exclusive lock the object.">Exlock</a>(<span class="keywordtype">void</span>);
<a name="l00545"></a>00545     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00123.html#a26cb78baedef9f6fded76793a2bab99b" title="Protocol interface to share lock the object.">Shlock</a>(<span class="keywordtype">void</span>);
<a name="l00546"></a>00546     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00046.html#a7fedd71fdd18b502b560a2d85eb55134" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l00547"></a>00547 
<a name="l00548"></a>00548 <span class="keyword">public</span>:
<a name="l00556"></a><a class="code" href="a00116.html">00556</a>     <span class="keyword">class </span>__EXPORT <a class="code" href="a00116.html" title="Gaurd class to apply scope based access locking to objects.">gaurd_reader</a>
<a name="l00557"></a>00557     {
<a name="l00558"></a>00558     <span class="keyword">private</span>:
<a name="l00559"></a>00559         <span class="keywordtype">void</span> *object;
<a name="l00560"></a>00560 
<a name="l00561"></a>00561     <span class="keyword">public</span>:
<a name="l00566"></a>00566         <a class="code" href="a00116.html" title="Gaurd class to apply scope based access locking to objects.">gaurd_reader</a>();
<a name="l00567"></a>00567 
<a name="l00572"></a>00572         <a class="code" href="a00116.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="l00573"></a>00573 
<a name="l00577"></a>00577         ~<a class="code" href="a00116.html" title="Gaurd class to apply scope based access locking to objects.">gaurd_reader</a>();
<a name="l00578"></a>00578 
<a name="l00584"></a>00584         <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">void</span> *object);
<a name="l00585"></a>00585 
<a name="l00589"></a>00589         <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00590"></a>00590 
<a name="l00596"></a><a class="code" href="a00116.html#a42977cab58bd736fb80b730ef2956467">00596</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>)
<a name="l00597"></a>00597             {<span class="keyword">set</span>(pointer);};
<a name="l00598"></a>00598     };
<a name="l00599"></a>00599 
<a name="l00607"></a><a class="code" href="a00117.html">00607</a>     <span class="keyword">class </span>__EXPORT <a class="code" href="a00117.html" title="Gaurd class to apply scope based exclusive locking to objects.">gaurd_writer</a>
<a name="l00608"></a>00608     {
<a name="l00609"></a>00609     <span class="keyword">private</span>:
<a name="l00610"></a>00610         <span class="keywordtype">void</span> *object;
<a name="l00611"></a>00611 
<a name="l00612"></a>00612     <span class="keyword">public</span>:
<a name="l00617"></a>00617         <a class="code" href="a00117.html" title="Gaurd class to apply scope based exclusive locking to objects.">gaurd_writer</a>();
<a name="l00618"></a>00618 
<a name="l00623"></a>00623         <a class="code" href="a00117.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="l00624"></a>00624 
<a name="l00628"></a>00628         ~<a class="code" href="a00117.html" title="Gaurd class to apply scope based exclusive locking to objects.">gaurd_writer</a>();
<a name="l00629"></a>00629 
<a name="l00635"></a>00635         <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">void</span> *object);
<a name="l00636"></a>00636 
<a name="l00640"></a>00640         <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00641"></a>00641 
<a name="l00647"></a><a class="code" href="a00117.html#aa07422f0293cdf05dd6cbc23489bd402">00647</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>)
<a name="l00648"></a>00648             {<span class="keyword">set</span>(pointer);};
<a name="l00649"></a>00649     };
<a name="l00650"></a>00650 
<a name="l00654"></a>00654     <a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock</a>();
<a name="l00655"></a>00655 
<a name="l00661"></a>00661     <span class="keywordtype">bool</span> <a class="code" href="a00200.html#aaaeabbd959a07e91ff1e0bfabf25f600" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>);
<a name="l00662"></a>00662 
<a name="l00668"></a>00668     <span class="keywordtype">bool</span> <a class="code" href="a00176.html#af11d6983ce975637031c6eaa0b8cf621" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>);
<a name="l00669"></a>00669 
<a name="l00676"></a>00676     <span class="keyword">static</span> <span class="keywordtype">void</span> indexing(<span class="keywordtype">unsigned</span> size);
<a name="l00677"></a>00677 
<a name="l00685"></a>00685     <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="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>);
<a name="l00686"></a>00686 
<a name="l00694"></a>00694     <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="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>);
<a name="l00695"></a>00695 
<a name="l00700"></a>00700     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" 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="l00701"></a>00701 
<a name="l00705"></a>00705     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00706"></a>00706 
<a name="l00711"></a>00711     <span class="keywordtype">unsigned</span> getAccess(<span class="keywordtype">void</span>);
<a name="l00712"></a>00712 
<a name="l00717"></a>00717     <span class="keywordtype">unsigned</span> getModify(<span class="keywordtype">void</span>);
<a name="l00718"></a>00718 
<a name="l00723"></a>00723     <span class="keywordtype">unsigned</span> getWaiting(<span class="keywordtype">void</span>);
<a name="l00724"></a>00724 
<a name="l00731"></a><a class="code" href="a00115.html#a698f7a21ccc9f1b4081b91372117c96c">00731</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00200.html#aaaeabbd959a07e91ff1e0bfabf25f600" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>)
<a name="l00732"></a>00732         {<span class="keywordflow">return</span> lock.<a class="code" href="a00115.html#ae17f207aea46577f3be10d68f3f8db99" title="Request modify (write) access through the lock.">modify</a>(timeout);};
<a name="l00733"></a>00733 
<a name="l00740"></a><a class="code" href="a00115.html#accce32cf57d9ab731727615cc4cbc16c">00740</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00176.html#af11d6983ce975637031c6eaa0b8cf621" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>)
<a name="l00741"></a>00741         {<span class="keywordflow">return</span> lock.<a class="code" href="a00115.html#a536e267f130b0e7afe7f0da61f6d458c" title="Request shared (read) access through the lock.">access</a>(timeout);};
<a name="l00742"></a>00742 
<a name="l00747"></a><a class="code" href="a00115.html#a1c1baeb5eafef496b4e15bcdc47e4de8">00747</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00748"></a>00748         {lock.<a class="code" href="a00115.html#aa4ffe032a42426585b5612f580e4c971" title="Release an arbitrary object that has been protected by a rwlock.">release</a>();};
<a name="l00749"></a>00749 };
<a name="l00750"></a>00750 
<a name="l00761"></a><a class="code" href="a00112.html">00761</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00112.html" title="Class for resource bound memory pools between threads.">ReusableAllocator</a> : <span class="keyword">protected</span> <a class="code" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l00762"></a>00762 {
<a name="l00763"></a>00763 <span class="keyword">protected</span>:
<a name="l00764"></a>00764     <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *freelist;
<a name="l00765"></a>00765     <span class="keywordtype">unsigned</span> waiting;
<a name="l00766"></a>00766 
<a name="l00770"></a>00770     <a class="code" href="a00112.html" title="Class for resource bound memory pools between threads.">ReusableAllocator</a>();
<a name="l00771"></a>00771 
<a name="l00777"></a><a class="code" href="a00112.html#a92dfe33ac8d7d3ee907a9b7793457eea">00777</a>     <span class="keyword">inline</span> <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *next(<a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keywordtype">object</span>)
<a name="l00778"></a>00778         {<span class="keywordflow">return</span> <span class="keywordtype">object</span>-&gt;<a class="code" href="a00113.html#adaf196c8e959596c86d7f7f9f95735fe" title="Get next effective reusable object when iterating.">getNext</a>();};
<a name="l00779"></a>00779 
<a name="l00784"></a>00784     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keywordtype">object</span>);
<a name="l00785"></a>00785 };
<a name="l00786"></a>00786 
<a name="l00797"></a><a class="code" href="a00036.html">00797</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a> : <span class="keyword">protected</span> <a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>, <span class="keyword">public</span> <a class="code" href="a00123.html" title="An exclusive locking protocol interface base.">Shared</a>
<a name="l00798"></a>00798 {
<a name="l00799"></a>00799 <span class="keyword">private</span>:
<a name="l00800"></a>00800     <span class="keyword">class </span>Context : <span class="keyword">public</span> <a class="code" href="a00065.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a>
<a name="l00801"></a>00801     {
<a name="l00802"></a>00802     <span class="keyword">public</span>:
<a name="l00803"></a>00803         <span class="keyword">inline</span> Context(<a class="code" href="a00065.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a> **root) : <a class="code" href="a00065.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a>(root) {};
<a name="l00804"></a>00804 
<a name="l00805"></a>00805         pthread_t thread;
<a name="l00806"></a>00806         <span class="keywordtype">unsigned</span> count;
<a name="l00807"></a>00807     };
<a name="l00808"></a>00808 
<a name="l00809"></a>00809     <a class="code" href="a00065.html" title="Common base class for all objects that can be formed into a linked list.">LinkedObject</a> *contexts;
<a name="l00810"></a>00810 
<a name="l00811"></a>00811     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00123.html#a26cb78baedef9f6fded76793a2bab99b" title="Protocol interface to share lock the object.">Shlock</a>(<span class="keywordtype">void</span>);
<a name="l00812"></a>00812     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00123.html#a6b45044278322065ffca2e42419baad6" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l00813"></a>00813     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00123.html#a63d1289ffd57015684a4e738edf2a4d5" title="Convert object to an exclusive lock.">Exclusive</a>(<span class="keywordtype">void</span>);
<a name="l00814"></a>00814     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00123.html#a0851333a32aa047b9de6ea0306b25645" title="Share the lock with other referencers.">Share</a>(<span class="keywordtype">void</span>);
<a name="l00815"></a>00815     __LOCAL Context *getContext(<span class="keywordtype">void</span>);
<a name="l00816"></a>00816 
<a name="l00817"></a>00817 <span class="keyword">public</span>:
<a name="l00821"></a>00821     <a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>();
<a name="l00822"></a>00822 
<a name="l00826"></a>00826     ~<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>();
<a name="l00827"></a>00827 
<a name="l00831"></a>00831     <span class="keywordtype">void</span> <a class="code" href="a00035.html#a1f3c9b6430890905b2ed7afa6aac5be7" title="Exclusive mode write thread scheduling.">modify</a>(<span class="keywordtype">void</span>);
<a name="l00832"></a>00832 
<a name="l00836"></a>00836     <span class="keywordtype">void</span> <a class="code" href="a00035.html#a926c3327686f18ee701775c606eae79d" title="Complete exclusive mode write scheduling.">commit</a>(<span class="keywordtype">void</span>);
<a name="l00837"></a>00837 
<a name="l00841"></a>00841     <span class="keywordtype">void</span> <a class="code" href="a00035.html#acaa6653b643ee9afb5a106690c5efe3e" title="Access mode shared thread scheduling.">access</a>(<span class="keywordtype">void</span>);
<a name="l00842"></a>00842 
<a name="l00846"></a>00846     <span class="keywordtype">void</span> <a class="code" href="a00035.html#ad78d46dc0992b34b27c13cf18b32b8b3" title="Release access mode read scheduling.">release</a>(<span class="keywordtype">void</span>);
<a name="l00847"></a>00847 
<a name="l00852"></a>00852     <span class="keywordtype">void</span> <a class="code" href="a00176.html#a740cc90f6867eb29e34a0efa0dddad40" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<span class="keywordtype">void</span>);
<a name="l00853"></a>00853 
<a name="l00857"></a>00857     <span class="keywordtype">void</span> <a class="code" href="a00176.html#aaa965208b479b06deb044874e4a86b42" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol.">share</a>(<span class="keywordtype">void</span>);
<a name="l00858"></a>00858 
<a name="l00862"></a>00862     <span class="keywordtype">unsigned</span> getReaders(<span class="keywordtype">void</span>);
<a name="l00863"></a>00863 
<a name="l00867"></a>00867     <span class="keywordtype">unsigned</span> getWaiters(<span class="keywordtype">void</span>);
<a name="l00868"></a>00868 
<a name="l00873"></a><a class="code" href="a00036.html#adbaa86cb0a0c6ccfbd4bd27e671c045d">00873</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00035.html#a1f3c9b6430890905b2ed7afa6aac5be7" title="Exclusive mode write thread scheduling.">modify</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00874"></a>00874         {lock.<a class="code" href="a00036.html#a31a992f0f164d87a1c84ea523fe117d9" title="Acquire write (exclusive modify) lock.">modify</a>();};
<a name="l00875"></a>00875 
<a name="l00880"></a><a class="code" href="a00036.html#a4d5f60f08c2279042f941ebd8a53eb10">00880</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00035.html#a926c3327686f18ee701775c606eae79d" title="Complete exclusive mode write scheduling.">commit</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00881"></a>00881         {lock.<a class="code" href="a00036.html#adcc16bc122c4b84547caf25cc804a14d" title="Commit changes / release a modify lock.">commit</a>();};
<a name="l00882"></a>00882 
<a name="l00887"></a><a class="code" href="a00036.html#a958c4c82013db8465d713c794528de7c">00887</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00035.html#ad78d46dc0992b34b27c13cf18b32b8b3" title="Release access mode read scheduling.">release</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00888"></a>00888         {lock.<a class="code" href="a00036.html#abd12452d2b279c589ac24d8c35a55232" title="Release a shared lock.">release</a>();};
<a name="l00889"></a>00889 
<a name="l00894"></a><a class="code" href="a00036.html#aaaa54bae5b17cde37881f5c08d662362">00894</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00035.html#acaa6653b643ee9afb5a106690c5efe3e" title="Access mode shared thread scheduling.">access</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00895"></a>00895         {lock.<a class="code" href="a00036.html#aa6e6f2a43d99dd68a75ce0e5e304d62b" title="Acquire access (shared read) lock.">access</a>();};
<a name="l00896"></a>00896 
<a name="l00901"></a><a class="code" href="a00036.html#ab013db85be522c8b898cfbce0f69543a">00901</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a740cc90f6867eb29e34a0efa0dddad40" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00902"></a>00902         {lock.<a class="code" href="a00036.html#a28a21a8f2735f8e1f2f6685f27e97a5a" title="Convert read lock into exclusive (write/modify) access.">exclusive</a>();};
<a name="l00903"></a>00903 
<a name="l00908"></a><a class="code" href="a00036.html#a8c5c595f7b80823ac93ae0f8f40e1262">00908</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#aaa965208b479b06deb044874e4a86b42" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol.">share</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l00909"></a>00909         {lock.<a class="code" href="a00036.html#aeaef77545588f04d19552225a47abf6b" title="Return an exclusive access lock back to share mode.">share</a>();};
<a name="l00910"></a>00910 };
<a name="l00911"></a>00911 
<a name="l00924"></a><a class="code" href="a00022.html">00924</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a> : <span class="keyword">private</span> <a class="code" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l00925"></a>00925 {
<a name="l00926"></a>00926 <span class="keyword">private</span>:
<a name="l00927"></a>00927     <span class="keywordtype">unsigned</span> count;
<a name="l00928"></a>00928     <span class="keywordtype">unsigned</span> waits;
<a name="l00929"></a>00929 
<a name="l00930"></a>00930 <span class="keyword">public</span>:
<a name="l00935"></a>00935     <a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>(<span class="keywordtype">unsigned</span> count);
<a name="l00936"></a>00936 
<a name="l00940"></a>00940     ~<a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>();
<a name="l00941"></a>00941 
<a name="l00947"></a>00947     <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">unsigned</span> count);
<a name="l00948"></a>00948 
<a name="l00952"></a>00952     <span class="keywordtype">void</span> inc(<span class="keywordtype">void</span>);
<a name="l00953"></a>00953 
<a name="l00957"></a>00957     <span class="keywordtype">void</span> dec(<span class="keywordtype">void</span>);
<a name="l00958"></a>00958 
<a name="l00963"></a>00963     <span class="keywordtype">unsigned</span> operator++(<span class="keywordtype">void</span>);
<a name="l00964"></a>00964 
<a name="l00965"></a>00965     <span class="keywordtype">unsigned</span> operator--(<span class="keywordtype">void</span>);
<a name="l00966"></a>00966 
<a name="l00970"></a>00970     <span class="keywordtype">void</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<span class="keywordtype">void</span>);
<a name="l00971"></a>00971 
<a name="l00978"></a>00978     <span class="keywordtype">bool</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00979"></a>00979 
<a name="l00984"></a><a class="code" href="a00022.html#a12bc3ca06662d92c61d2c41cabfcb617">00984</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>&amp; sync)
<a name="l00985"></a>00985         {sync.<a class="code" href="a00022.html#a97f3b020a0d0c59c78f1933e84da908e" title="Wait at the barrier until the count of threads waiting is reached.">wait</a>();};
<a name="l00986"></a>00986 
<a name="l00993"></a><a class="code" href="a00022.html#a1a3a80016c9115d200ecfd315e6b22d4">00993</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>&amp; sync, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l00994"></a>00994         {<span class="keywordflow">return</span> sync.<a class="code" href="a00022.html#a97f3b020a0d0c59c78f1933e84da908e" title="Wait at the barrier until the count of threads waiting is reached.">wait</a>(timeout);};
<a name="l00995"></a>00995 
<a name="l00996"></a>00996 
<a name="l01002"></a><a class="code" href="a00022.html#aaff01c54a501eea52da4c4786bc01404">01002</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="a00022.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="l01003"></a>01003         {sync.set(count);};
<a name="l01004"></a>01004 };
<a name="l01005"></a>01005 
<a name="l01014"></a><a class="code" href="a00120.html">01014</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a> : <span class="keyword">public</span> <a class="code" href="a00123.html" title="An exclusive locking protocol interface base.">Shared</a>, <span class="keyword">private</span> <a class="code" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes.">Conditional</a>
<a name="l01015"></a>01015 {
<a name="l01016"></a>01016 <span class="keyword">private</span>:
<a name="l01017"></a>01017     <span class="keywordtype">unsigned</span> count, waits, used;
<a name="l01018"></a>01018 
<a name="l01019"></a>01019     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00123.html#a26cb78baedef9f6fded76793a2bab99b" title="Protocol interface to share lock the object.">Shlock</a>(<span class="keywordtype">void</span>);
<a name="l01020"></a>01020     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00123.html#a6b45044278322065ffca2e42419baad6" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l01021"></a>01021 
<a name="l01022"></a>01022 <span class="keyword">public</span>:
<a name="l01026"></a>01026     <a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a>(<span class="keywordtype">unsigned</span> count = 0);
<a name="l01027"></a>01027 
<a name="l01032"></a>01032     <span class="keywordtype">void</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<span class="keywordtype">void</span>);
<a name="l01033"></a>01033 
<a name="l01041"></a>01041     <span class="keywordtype">bool</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l01042"></a>01042 
<a name="l01047"></a>01047     <span class="keywordtype">unsigned</span> getCount(<span class="keywordtype">void</span>);
<a name="l01048"></a>01048 
<a name="l01053"></a>01053     <span class="keywordtype">unsigned</span> getUsed(<span class="keywordtype">void</span>);
<a name="l01054"></a>01054 
<a name="l01059"></a>01059     <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">unsigned</span> count);
<a name="l01060"></a>01060 
<a name="l01064"></a>01064     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01065"></a>01065 
<a name="l01069"></a><a class="code" href="a00120.html#a7c26ab11b1d00582c4cd9c1057e73d8e">01069</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> operator++(<span class="keywordtype">void</span>)
<a name="l01070"></a>01070         {<a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>();};
<a name="l01071"></a>01071 
<a name="l01075"></a><a class="code" href="a00120.html#a201d422b74f5f8046fd6b0e471b9d094">01075</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> operator--(<span class="keywordtype">void</span>)
<a name="l01076"></a>01076         {<a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>();};
<a name="l01077"></a>01077 
<a name="l01082"></a><a class="code" href="a00120.html#a2968901188dceaf619a89218acfdaf0e">01082</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a>&amp; sync)
<a name="l01083"></a>01083         {sync.<a class="code" href="a00120.html#af0e430d192c44be1d65f5a4fd8cb91a4" title="Wait until the semphore usage count is less than the thread limit.">wait</a>();};
<a name="l01084"></a>01084 
<a name="l01091"></a><a class="code" href="a00120.html#aa1a7bf3c1b0bb42cab64385e014ab997">01091</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="a00034.html#acccee2ab9fdf234e0617cf35d5ce1cf8" title="Wait (block) until signalled.">wait</a>(<a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a>&amp; sync, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l01092"></a>01092         {<span class="keywordflow">return</span> sync.<a class="code" href="a00120.html#af0e430d192c44be1d65f5a4fd8cb91a4" title="Wait until the semphore usage count is less than the thread limit.">wait</a>(timeout);};
<a name="l01093"></a>01093 
<a name="l01098"></a><a class="code" href="a00120.html#acd0e3d8758ffac9158230c4dfc692a1c">01098</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a>&amp; sync)
<a name="l01099"></a>01099         {sync.<a class="code" href="a00120.html#ad845afe88e4360a3c4dc425c32255200" title="Release the semaphore after waiting for it.">release</a>();};
<a name="l01100"></a>01100 };
<a name="l01101"></a>01101 
<a name="l01115"></a><a class="code" href="a00084.html">01115</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a> : <span class="keyword">public</span> <a class="code" href="a00046.html" title="An exclusive locking protocol interface base.">Exclusive</a>
<a name="l01116"></a>01116 {
<a name="l01117"></a>01117 <span class="keyword">private</span>:
<a name="l01118"></a>01118     pthread_mutex_t mlock;
<a name="l01119"></a>01119 
<a name="l01120"></a>01120     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00046.html#accddc12c1829bda27c53704460f65dbc" title="Protocol interface to exclusive lock the object.">Exlock</a>(<span class="keywordtype">void</span>);
<a name="l01121"></a>01121     __LOCAL <span class="keywordtype">void</span> <a class="code" href="a00046.html#a7fedd71fdd18b502b560a2d85eb55134" title="Protocol interface to release a lock.">Unlock</a>(<span class="keywordtype">void</span>);
<a name="l01122"></a>01122 
<a name="l01123"></a>01123 <span class="keyword">public</span>:
<a name="l01131"></a><a class="code" href="a00085.html">01131</a>     <span class="keyword">class </span>__EXPORT <a class="code" href="a00085.html" title="Gaurd class to apply scope based mutex locking to objects.">gaurd</a>
<a name="l01132"></a>01132     {
<a name="l01133"></a>01133     <span class="keyword">private</span>:
<a name="l01134"></a>01134         <span class="keywordtype">void</span> *object;
<a name="l01135"></a>01135 
<a name="l01136"></a>01136     <span class="keyword">public</span>:
<a name="l01141"></a>01141         <a class="code" href="a00085.html" title="Gaurd class to apply scope based mutex locking to objects.">gaurd</a>();
<a name="l01142"></a>01142 
<a name="l01147"></a>01147         <a class="code" href="a00085.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="l01148"></a>01148 
<a name="l01152"></a>01152         ~<a class="code" href="a00085.html" title="Gaurd class to apply scope based mutex locking to objects.">gaurd</a>();
<a name="l01153"></a>01153 
<a name="l01159"></a>01159         <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">void</span> *object);
<a name="l01160"></a>01160 
<a name="l01164"></a>01164         <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01165"></a>01165 
<a name="l01171"></a><a class="code" href="a00085.html#a06a6698b5ea9ea387c581388e3d847c9">01171</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>)
<a name="l01172"></a>01172             {<span class="keyword">set</span>(pointer);};
<a name="l01173"></a>01173     };
<a name="l01174"></a>01174 
<a name="l01175"></a>01175 
<a name="l01179"></a>01179     <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>();
<a name="l01180"></a>01180 
<a name="l01184"></a>01184     ~<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>();
<a name="l01185"></a>01185 
<a name="l01189"></a><a class="code" href="a00084.html#ac723b61d25b59af72ca2b16e71e2ee2c">01189</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a05e1c5a08bac3a310247fe41ad996efc" title="Convenience function to acquire a mutex.">acquire</a>(<span class="keywordtype">void</span>)
<a name="l01190"></a>01190         {pthread_mutex_lock(&amp;mlock);};
<a name="l01191"></a>01191 
<a name="l01195"></a><a class="code" href="a00084.html#a5d3b8bc911438e7ae7c2f4f84f0bd854">01195</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<span class="keywordtype">void</span>)
<a name="l01196"></a>01196         {pthread_mutex_lock(&amp;mlock);};
<a name="l01197"></a>01197 
<a name="l01201"></a><a class="code" href="a00084.html#a1adc34a3ceb39c88ee7989b10123136e">01201</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a1c26a3ce6612b64ea0eeced9deaad61f" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<span class="keywordtype">void</span>)
<a name="l01202"></a>01202         {pthread_mutex_unlock(&amp;mlock);};
<a name="l01203"></a>01203 
<a name="l01207"></a><a class="code" href="a00084.html#a210b7d6293efc693d5a72f24553eea07">01207</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>)
<a name="l01208"></a>01208         {pthread_mutex_unlock(&amp;mlock);};
<a name="l01209"></a>01209 
<a name="l01214"></a><a class="code" href="a00084.html#aa60864d3558a43ba3af37c5f74472205">01214</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a05e1c5a08bac3a310247fe41ad996efc" title="Convenience function to acquire a mutex.">acquire</a>(<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01215"></a>01215         {pthread_mutex_lock(&amp;lock.mlock);};
<a name="l01216"></a>01216 
<a name="l01221"></a><a class="code" href="a00084.html#a5afae8856833671613512893c1e888d4">01221</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01222"></a>01222         {pthread_mutex_lock(&amp;lock.mlock);};
<a name="l01223"></a>01223 
<a name="l01228"></a><a class="code" href="a00084.html#a50469a37f1db00346009e95594263cd7">01228</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a1c26a3ce6612b64ea0eeced9deaad61f" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01229"></a>01229         {pthread_mutex_unlock(&amp;lock.mlock);};
<a name="l01230"></a>01230 
<a name="l01235"></a><a class="code" href="a00084.html#a0f86a52acb3f48f707ba5fa9dcd22d13">01235</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>&amp; <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01236"></a>01236         {pthread_mutex_unlock(&amp;lock.mlock);};
<a name="l01237"></a>01237 
<a name="l01242"></a><a class="code" href="a00084.html#a4700b648d5f21638de9754cc29e39932">01242</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a05e1c5a08bac3a310247fe41ad996efc" title="Convenience function to acquire a mutex.">acquire</a>(pthread_mutex_t *<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01243"></a>01243         {pthread_mutex_lock(lock);};
<a name="l01244"></a>01244 
<a name="l01249"></a><a class="code" href="a00084.html#a6d5aac9be2ba1e9649c8896c58b2b552">01249</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>(pthread_mutex_t *<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01250"></a>01250         {pthread_mutex_lock(lock);};
<a name="l01251"></a>01251 
<a name="l01256"></a><a class="code" href="a00084.html#a4b49e30f5cd30e6b1400e8b9f2ab55e6">01256</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a1c26a3ce6612b64ea0eeced9deaad61f" title="Convenience function to unlock an exclusive object through it&amp;#39;s protocol.">unlock</a>(pthread_mutex_t *<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01257"></a>01257         {pthread_mutex_unlock(lock);};
<a name="l01258"></a>01258 
<a name="l01263"></a><a class="code" href="a00084.html#ab21bca0da8f98da541f70981fb76153f">01263</a>     <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(pthread_mutex_t *<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l01264"></a>01264         {pthread_mutex_unlock(lock);};
<a name="l01265"></a>01265 
<a name="l01272"></a>01272     <span class="keyword">static</span> <span class="keywordtype">void</span> indexing(<span class="keywordtype">unsigned</span> size);
<a name="l01273"></a>01273 
<a name="l01279"></a>01279     <span class="keyword">static</span> <span class="keywordtype">void</span> protect(<span class="keywordtype">void</span> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01280"></a>01280 
<a name="l01285"></a>01285     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01286"></a>01286 };
<a name="l01287"></a>01287 
<a name="l01296"></a><a class="code" href="a00020.html">01296</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00020.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>
<a name="l01297"></a>01297 {
<a name="l01298"></a>01298 <span class="keyword">private</span>:
<a name="l01299"></a>01299     <span class="comment">// cannot copy...</span>
<a name="l01300"></a>01300     <span class="keyword">inline</span> <a class="code" href="a00020.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>(<span class="keyword">const</span> <a class="code" href="a00019.html" title="A general purpose smart pointer helper class.">auto_object</a> &amp;<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>) {};
<a name="l01301"></a>01301 
<a name="l01302"></a>01302 <span class="keyword">protected</span>:
<a name="l01303"></a>01303     <span class="keywordtype">void</span> *object;
<a name="l01304"></a>01304 
<a name="l01305"></a>01305     <a class="code" href="a00020.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">public</span>:
<a name="l01312"></a>01312     <a class="code" href="a00020.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="l01313"></a>01313 
<a name="l01318"></a>01318     ~<a class="code" href="a00020.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>();
<a name="l01319"></a>01319 
<a name="l01323"></a>01323     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01324"></a>01324 
<a name="l01329"></a><a class="code" href="a00020.html#a0ba4f22b083d5b0d4ba0570b20ac5b64">01329</a>     <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()<span class="keyword"> const</span>
<a name="l01330"></a>01330 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keywordtype">object</span> == NULL;};
<a name="l01331"></a>01331 
<a name="l01336"></a><a class="code" href="a00020.html#a72463c88ac54dc49624ffcafccea9e8a">01336</a>     <span class="keyword">inline</span> operator bool()<span class="keyword"> const</span>
<a name="l01337"></a>01337 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keywordtype">object</span> != NULL;};
<a name="l01338"></a>01338 
<a name="l01345"></a>01345     <span class="keywordtype">void</span> operator=(<span class="keywordtype">void</span> *<span class="keywordtype">object</span>);
<a name="l01346"></a>01346 };
<a name="l01347"></a>01347 
<a name="l01359"></a><a class="code" href="a00070.html">01359</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00070.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>
<a name="l01360"></a>01360 {
<a name="l01361"></a>01361 <span class="keyword">private</span>:
<a name="l01362"></a>01362     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>;
<a name="l01363"></a>01363     pthread_mutex_t <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>;
<a name="l01364"></a>01364     <a class="code" href="a00091.html" title="A common base class for all managed objects.">Object</a> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>;
<a name="l01365"></a>01365 
<a name="l01366"></a>01366 <span class="keyword">protected</span>:
<a name="l01370"></a>01370     <a class="code" href="a00070.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>();
<a name="l01371"></a>01371 
<a name="l01376"></a>01376     <span class="keywordtype">void</span> replace(<a class="code" href="a00091.html" title="A common base class for all managed objects.">Object</a> *<span class="keywordtype">object</span>);
<a name="l01377"></a>01377 
<a name="l01382"></a>01382     <a class="code" href="a00091.html" title="A common base class for all managed objects.">Object</a> *dup(<span class="keywordtype">void</span>);
<a name="l01383"></a>01383 
<a name="l01388"></a><a class="code" href="a00070.html#a6fab254a9e41a7adb8570371c0cc5c8d">01388</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00069.html#ac96f3ce32f7843140dd7eae9a9218430" title="Assign a locked object pointer.">operator=</a>(<a class="code" href="a00091.html" title="A common base class for all managed objects.">Object</a> *<span class="keywordtype">object</span>)
<a name="l01389"></a>01389         {replace(<span class="keywordtype">object</span>);};
<a name="l01390"></a>01390 };
<a name="l01391"></a>01391 
<a name="l01400"></a><a class="code" href="a00128.html">01400</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00128.html" title="Shared singleton object.">SharedObject</a>
<a name="l01401"></a>01401 {
<a name="l01402"></a>01402 <span class="keyword">protected</span>:
<a name="l01403"></a>01403     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>;
<a name="l01404"></a>01404 
<a name="l01413"></a>01413     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a1cba76e7b293fb1dd2a1606a7d24a125" title="Convenience function to commit an exclusive access lock.">commit</a>(<a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01414"></a>01414 
<a name="l01415"></a>01415 <span class="keyword">public</span>:
<a name="l01419"></a>01419     <span class="keyword">virtual</span> ~<a class="code" href="a00128.html" title="Shared singleton object.">SharedObject</a>();
<a name="l01420"></a>01420 };
<a name="l01421"></a>01421 
<a name="l01432"></a><a class="code" href="a00129.html">01432</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00129.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="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a>
<a name="l01433"></a>01433 {
<a name="l01434"></a>01434 <span class="keyword">private</span>:
<a name="l01435"></a>01435     <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>;
<a name="l01436"></a>01436     <a class="code" href="a00128.html" title="Shared singleton object.">SharedObject</a> *<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>;
<a name="l01437"></a>01437 
<a name="l01438"></a>01438 <span class="keyword">protected</span>:
<a name="l01442"></a>01442     <a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>();
<a name="l01443"></a>01443 
<a name="l01447"></a>01447     ~<a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>();
<a name="l01448"></a>01448 
<a name="l01455"></a>01455     <span class="keywordtype">void</span> replace(<a class="code" href="a00128.html" title="Shared singleton object.">SharedObject</a> *<span class="keywordtype">object</span>);
<a name="l01456"></a>01456 
<a name="l01463"></a>01463     <a class="code" href="a00128.html" title="Shared singleton object.">SharedObject</a> *<a class="code" href="a00176.html#aaa965208b479b06deb044874e4a86b42" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol.">share</a>(<span class="keywordtype">void</span>);
<a name="l01464"></a>01464 };
<a name="l01465"></a>01465 
<a name="l01476"></a><a class="code" href="a00158.html">01476</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00158.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>
<a name="l01477"></a>01477 {
<a name="l01478"></a>01478 <span class="keyword">protected</span>:
<a name="l01479"></a>01479     pthread_t tid;
<a name="l01480"></a>01480     <span class="keywordtype">size_t</span> <a class="code" href="a00147.html" title="Manage a thread-safe stack of objects through reference pointers.">stack</a>;
<a name="l01481"></a>01481     <span class="keywordtype">int</span> priority;
<a name="l01482"></a>01482 
<a name="l01488"></a>01488     <a class="code" href="a00158.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="a00147.html" title="Manage a thread-safe stack of objects through reference pointers.">stack</a> = 0);
<a name="l01489"></a>01489 
<a name="l01494"></a>01494     <span class="keywordtype">void</span> map(<span class="keywordtype">void</span>);
<a name="l01495"></a>01495 
<a name="l01496"></a>01496 <span class="keyword">public</span>:
<a name="l01503"></a>01503     <span class="keywordtype">void</span> setPriority(<span class="keywordtype">void</span>);
<a name="l01504"></a>01504 
<a name="l01509"></a>01509     <span class="keyword">static</span> <span class="keywordtype">void</span> yield(<span class="keywordtype">void</span>);
<a name="l01510"></a>01510 
<a name="l01515"></a>01515     <span class="keyword">static</span> <span class="keywordtype">void</span> sleep(<a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l01516"></a>01516 
<a name="l01523"></a>01523     <span class="keyword">static</span> <a class="code" href="a00158.html" title="An abstract class for defining classes that operate as a thread.">Thread</a> *<span class="keyword">get</span>(void);
<a name="l01524"></a>01524 
<a name="l01528"></a>01528     <span class="keyword">virtual</span> <span class="keywordtype">void</span> run(<span class="keywordtype">void</span>) = 0;
<a name="l01529"></a>01529 
<a name="l01533"></a>01533     <span class="keyword">virtual</span> ~<a class="code" href="a00158.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>();
<a name="l01534"></a>01534 
<a name="l01543"></a>01543     <span class="keyword">virtual</span> <span class="keywordtype">void</span> exit(<span class="keywordtype">void</span>);
<a name="l01544"></a>01544 
<a name="l01548"></a>01548     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="a00193.html#a5fc126f9a4406cb2d0d054488cf00809" title="Template function to initialize memory by invoking default constructor.">init</a>(<span class="keywordtype">void</span>);
<a name="l01549"></a>01549 
<a name="l01555"></a>01555     <span class="keyword">static</span> <span class="keywordtype">void</span> policy(<span class="keywordtype">int</span> polid);
<a name="l01556"></a>01556 
<a name="l01561"></a>01561     <span class="keyword">static</span> <span class="keywordtype">void</span> concurrency(<span class="keywordtype">int</span> level);
<a name="l01562"></a>01562 
<a name="l01569"></a>01569     <span class="keyword">static</span> <span class="keywordtype">bool</span> equal(pthread_t thread1, pthread_t thread2);
<a name="l01570"></a>01570 
<a name="l01575"></a>01575     <span class="keyword">static</span> pthread_t <span class="keyword">self</span>(void);
<a name="l01576"></a>01576 };
<a name="l01577"></a>01577 
<a name="l01588"></a><a class="code" href="a00052.html">01588</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00052.html" title="A child thread object that may be joined by parent.">JoinableThread</a> : <span class="keyword">protected</span> <a class="code" href="a00158.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>
<a name="l01589"></a>01589 {
<a name="l01590"></a>01590 <span class="keyword">protected</span>:
<a name="l01591"></a>01591 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l01592"></a>01592 <span class="preprocessor"></span>    HANDLE joining;
<a name="l01593"></a>01593 <span class="preprocessor">#else</span>
<a name="l01594"></a>01594 <span class="preprocessor"></span>    <span class="keyword">volatile</span> <span class="keywordtype">bool</span> running;
<a name="l01595"></a>01595 <span class="preprocessor">#endif</span>
<a name="l01596"></a>01596 <span class="preprocessor"></span>
<a name="l01601"></a>01601     <a class="code" href="a00052.html" title="A child thread object that may be joined by parent.">JoinableThread</a>(<span class="keywordtype">size_t</span> size = 0);
<a name="l01602"></a>01602 
<a name="l01607"></a>01607     <span class="keyword">virtual</span> ~<a class="code" href="a00052.html" title="A child thread object that may be joined by parent.">JoinableThread</a>();
<a name="l01608"></a>01608 
<a name="l01614"></a>01614     <span class="keywordtype">void</span> join(<span class="keywordtype">void</span>);
<a name="l01615"></a>01615 
<a name="l01616"></a>01616 <span class="keyword">public</span>:
<a name="l01617"></a>01617 <span class="preprocessor">#ifdef  _MSWINDOWS_</span>
<a name="l01618"></a>01618 <span class="preprocessor"></span>    <span class="keyword">inline</span> <span class="keywordtype">bool</span> isRunning(<span class="keywordtype">void</span>)
<a name="l01619"></a>01619         {<span class="keywordflow">return</span> (joining != INVALID_HANDLE_VALUE);};
<a name="l01620"></a>01620 <span class="preprocessor">#else</span>
<a name="l01621"></a>01621 <span class="preprocessor"></span>
<a name="l01625"></a><a class="code" href="a00052.html#a45a210bcb19f1ed3b61735da9656b961">01625</a>     <span class="keyword">inline</span> <span class="keywordtype">bool</span> isRunning(<span class="keywordtype">void</span>)
<a name="l01626"></a>01626         {<span class="keywordflow">return</span> running;};
<a name="l01627"></a>01627 <span class="preprocessor">#endif</span>
<a name="l01628"></a>01628 <span class="preprocessor"></span>
<a name="l01637"></a>01637     <span class="keywordtype">void</span> <a class="code" href="a00200.html#af918d5bcdf14569774aa2c0b87bad662" title="Convenience function to start a joinable thread.">start</a>(<span class="keywordtype">int</span> priority = 0);
<a name="l01638"></a>01638 
<a name="l01643"></a><a class="code" href="a00052.html#a7382073cb9645be9b8221fcacff4b102">01643</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> background(<span class="keywordtype">void</span>)
<a name="l01644"></a>01644         {<a class="code" href="a00200.html#af918d5bcdf14569774aa2c0b87bad662" title="Convenience function to start a joinable thread.">start</a>(-1);};
<a name="l01645"></a>01645 };
<a name="l01646"></a>01646 
<a name="l01654"></a><a class="code" href="a00043.html">01654</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00043.html" title="A detached thread object that is stand-alone.">DetachedThread</a> : <span class="keyword">protected</span> <a class="code" href="a00158.html" title="An abstract class for defining classes that operate as a thread.">Thread</a>
<a name="l01655"></a>01655 {
<a name="l01656"></a>01656 <span class="keyword">protected</span>:
<a name="l01661"></a>01661     <a class="code" href="a00043.html" title="A detached thread object that is stand-alone.">DetachedThread</a>(<span class="keywordtype">size_t</span> size = 0);
<a name="l01662"></a>01662 
<a name="l01668"></a>01668     ~<a class="code" href="a00043.html" title="A detached thread object that is stand-alone.">DetachedThread</a>();
<a name="l01669"></a>01669 
<a name="l01678"></a>01678     <span class="keywordtype">void</span> <a class="code" href="a00158.html#af24cfbd01b314e405c97af4cbddb0c43" title="Exit the thread context.">exit</a>(<span class="keywordtype">void</span>);
<a name="l01679"></a>01679 
<a name="l01680"></a>01680 <span class="keyword">public</span>:
<a name="l01687"></a>01687     <span class="keywordtype">void</span> <a class="code" href="a00200.html#af918d5bcdf14569774aa2c0b87bad662" title="Convenience function to start a joinable thread.">start</a>(<span class="keywordtype">int</span> priority = 0);
<a name="l01688"></a>01688 };
<a name="l01689"></a>01689 
<a name="l01698"></a><a class="code" href="a00069.html">01698</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>
<a name="l01699"></a>01699 {
<a name="l01700"></a>01700 <span class="keyword">protected</span>:
<a name="l01701"></a><a class="code" href="a00069.html#a02d99a5b644dd18d77301c6475219382">01701</a>     <a class="code" href="a00091.html" title="A common base class for all managed objects.">Object</a> *<a class="code" href="a00069.html#a02d99a5b644dd18d77301c6475219382" title="locked object protected by locked_release">object</a>; 
<a name="l01706"></a>01706     <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>();
<a name="l01707"></a>01707 
<a name="l01713"></a>01713     <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>(<span class="keyword">const</span> <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a> &amp;<span class="keywordtype">object</span>);
<a name="l01714"></a>01714 
<a name="l01715"></a>01715 <span class="keyword">public</span>:
<a name="l01721"></a>01721     <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>(<a class="code" href="a00070.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a> &amp;<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01722"></a>01722 
<a name="l01727"></a>01727     ~<a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>();
<a name="l01728"></a>01728 
<a name="l01732"></a>01732     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01733"></a>01733 
<a name="l01739"></a>01739     <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a> &amp;operator=(<a class="code" href="a00070.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a> &amp;<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01740"></a>01740 };
<a name="l01741"></a>01741 
<a name="l01751"></a><a class="code" href="a00127.html">01751</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>
<a name="l01752"></a>01752 {
<a name="l01753"></a>01753 <span class="keyword">protected</span>:
<a name="l01754"></a><a class="code" href="a00127.html#afbc5bedc3f622465083742cd2c14cc8a">01754</a>     <a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> *<a class="code" href="a00127.html#afbc5bedc3f622465083742cd2c14cc8a" title="Shared lock for protected singleton.">ptr</a>; 
<a name="l01759"></a>01759     <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>();
<a name="l01760"></a>01760 
<a name="l01766"></a>01766     <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>(<span class="keyword">const</span> <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a> &amp;<span class="keywordtype">object</span>);
<a name="l01767"></a>01767 
<a name="l01768"></a>01768 <span class="keyword">public</span>:
<a name="l01773"></a>01773     <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>(<a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> &amp;<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01774"></a>01774 
<a name="l01780"></a>01780     ~<a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>();
<a name="l01781"></a>01781 
<a name="l01785"></a>01785     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l01786"></a>01786 
<a name="l01791"></a>01791     <a class="code" href="a00128.html" title="Shared singleton object.">SharedObject</a> *<span class="keyword">get</span>(void);
<a name="l01792"></a>01792 
<a name="l01798"></a>01798     <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a> &amp;operator=(<a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a> &amp;<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>);
<a name="l01799"></a>01799 };
<a name="l01800"></a>01800 
<a name="l01808"></a>01808 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01809"></a><a class="code" href="a00126.html">01809</a> <span class="keyword">class </span><a class="code" href="a00126.html" title="Templated shared pointer for singleton shared objects of specific type.">shared_pointer</a> : <span class="keyword">public</span> <a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>
<a name="l01810"></a>01810 {
<a name="l01811"></a>01811 <span class="keyword">public</span>:
<a name="l01815"></a><a class="code" href="a00126.html#a85163f2afb73a320ff1dcc045e6fff67">01815</a>     <span class="keyword">inline</span> <a class="code" href="a00126.html#a85163f2afb73a320ff1dcc045e6fff67" title="Created shared locking for typed singleton pointer.">shared_pointer</a>() : <a class="code" href="a00129.html" title="The shared pointer is used to manage a singleton instance of shared object.">SharedPointer</a>() {};
<a name="l01816"></a>01816 
<a name="l01824"></a><a class="code" href="a00126.html#acfde1a4fad8fe9b236afc4a1f4ce8f63">01824</a>     <span class="keyword">inline</span> <span class="keyword">const</span> T *<a class="code" href="a00126.html#acfde1a4fad8fe9b236afc4a1f4ce8f63" title="Acquire a shared (duplocate) reference to the typed singleton object.">dup</a>(<span class="keywordtype">void</span>)
<a name="l01825"></a>01825         {<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="a00129.html#a820cfc523b9090cf37ee62a937727666" title="Acquire a shared reference to the singleton object.">SharedPointer::share</a>());};
<a name="l01826"></a>01826 
<a name="l01833"></a><a class="code" href="a00126.html#a30bca2a8bbf7a51b87c1e3ff2e3621ff">01833</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00126.html#a30bca2a8bbf7a51b87c1e3ff2e3621ff" title="Replace existing typed singleton instance with new one.">replace</a>(T *<span class="keywordtype">object</span>)
<a name="l01834"></a>01834         {<a class="code" href="a00126.html#a30bca2a8bbf7a51b87c1e3ff2e3621ff" title="Replace existing typed singleton instance with new one.">SharedPointer::replace</a>(<span class="keywordtype">object</span>);};
<a name="l01835"></a>01835 
<a name="l01840"></a><a class="code" href="a00126.html#a2ba787193b82b415f26d82d9e3639c02">01840</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00126.html#a2ba787193b82b415f26d82d9e3639c02" title="Replace existing typed singleton object through assignment.">operator=</a>(T *<span class="keywordtype">object</span>)
<a name="l01841"></a>01841         {<a class="code" href="a00126.html#a30bca2a8bbf7a51b87c1e3ff2e3621ff" title="Replace existing typed singleton instance with new one.">replace</a>(<span class="keywordtype">object</span>);};
<a name="l01842"></a>01842 
<a name="l01847"></a><a class="code" href="a00126.html#a5308e29ed0e7ed0b6f0dabb172f87cb0">01847</a>     <span class="keyword">inline</span> T *<a class="code" href="a00126.html#a5308e29ed0e7ed0b6f0dabb172f87cb0" title="Access shared lock typed singleton object by pointer reference.">operator*</a>()
<a name="l01848"></a>01848         {<span class="keywordflow">return</span> <a class="code" href="a00126.html#acfde1a4fad8fe9b236afc4a1f4ce8f63" title="Acquire a shared (duplocate) reference to the typed singleton object.">dup</a>();};
<a name="l01849"></a>01849 };
<a name="l01850"></a>01850 
<a name="l01858"></a>01858 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01859"></a><a class="code" href="a00068.html">01859</a> <span class="keyword">class </span><a class="code" href="a00068.html" title="Templated locked pointer for referencing locked objects of specific type.">locked_pointer</a> : <span class="keyword">public</span> <a class="code" href="a00070.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>
<a name="l01860"></a>01860 {
<a name="l01861"></a>01861 <span class="keyword">public</span>:
<a name="l01865"></a><a class="code" href="a00068.html#ac57fcab6ef15b36f6e88f8e630cfe45e">01865</a>     <span class="keyword">inline</span> <a class="code" href="a00068.html#ac57fcab6ef15b36f6e88f8e630cfe45e" title="Create an instance of a typed locked pointer.">locked_pointer</a>() : <a class="code" href="a00070.html" title="An object pointer that uses mutex to assure thread-safe singleton use.">LockedPointer</a>() {};
<a name="l01866"></a>01866 
<a name="l01872"></a><a class="code" href="a00068.html#a80d698907dcd4b8d38ba75b48e134754">01872</a>     <span class="keyword">inline</span> T* <a class="code" href="a00068.html#a80d698907dcd4b8d38ba75b48e134754" title="Create a duplicate reference counted instance of the current typed object.">dup</a>(<span class="keywordtype">void</span>)
<a name="l01873"></a>01873         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T *<span class="keyword">&gt;</span>(<a class="code" href="a00068.html#a80d698907dcd4b8d38ba75b48e134754" title="Create a duplicate reference counted instance of the current typed object.">LockedPointer::dup</a>());};
<a name="l01874"></a>01874 
<a name="l01879"></a><a class="code" href="a00068.html#a48eff0ecf1b47bcd60e9ab4af8b1420b">01879</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00068.html#a48eff0ecf1b47bcd60e9ab4af8b1420b" title="Replace existing typed object with a new one for next request.">replace</a>(T *<span class="keywordtype">object</span>)
<a name="l01880"></a>01880         {<a class="code" href="a00068.html#a48eff0ecf1b47bcd60e9ab4af8b1420b" title="Replace existing typed object with a new one for next request.">LockedPointer::replace</a>(<span class="keywordtype">object</span>);};
<a name="l01881"></a>01881 
<a name="l01886"></a><a class="code" href="a00068.html#a0ea46e4db6a2e8a1485652782614ece6">01886</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00068.html#a0ea46e4db6a2e8a1485652782614ece6" title="Replace existing object through assignment.">operator=</a>(T *<span class="keywordtype">object</span>)
<a name="l01887"></a>01887         {<a class="code" href="a00068.html#a48eff0ecf1b47bcd60e9ab4af8b1420b" title="Replace existing typed object with a new one for next request.">replace</a>(<span class="keywordtype">object</span>);};
<a name="l01888"></a>01888 
<a name="l01894"></a><a class="code" href="a00068.html#ad4fd532d16db4d848672dc59c327153f">01894</a>     <span class="keyword">inline</span> T *<a class="code" href="a00068.html#ad4fd532d16db4d848672dc59c327153f" title="Create a duplicate reference counted instance of the current typed object by pointer reference...">operator*</a>()
<a name="l01895"></a>01895         {<span class="keywordflow">return</span> <a class="code" href="a00068.html#a80d698907dcd4b8d38ba75b48e134754" title="Create a duplicate reference counted instance of the current typed object.">dup</a>();};
<a name="l01896"></a>01896 };
<a name="l01897"></a>01897 
<a name="l01903"></a>01903 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01904"></a><a class="code" href="a00067.html">01904</a> <span class="keyword">class </span><a class="code" href="a00067.html" title="A templated smart pointer instance for lock protected objects.">locked_instance</a> : <span class="keyword">public</span> <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>
<a name="l01905"></a>01905 {
<a name="l01906"></a>01906 <span class="keyword">public</span>:
<a name="l01910"></a><a class="code" href="a00067.html#a1c13b003717b3d9ab896477a6b0d931c">01910</a>     <span class="keyword">inline</span> <a class="code" href="a00067.html#a1c13b003717b3d9ab896477a6b0d931c" title="Construct empty locked instance of typed object.">locked_instance</a>() : <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>() {};
<a name="l01911"></a>01911 
<a name="l01916"></a><a class="code" href="a00067.html#a2c9e9832787d2de913fe65c00b1f21a7">01916</a>     <span class="keyword">inline</span> <a class="code" href="a00067.html#a2c9e9832787d2de913fe65c00b1f21a7" title="Construct locked instance of typed object from matching locked_pointer.">locked_instance</a>(<a class="code" href="a00068.html" title="Templated locked pointer for referencing locked objects of specific type.">locked_pointer&lt;T&gt;</a> &amp;<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>) : <a class="code" href="a00069.html" title="Auto-pointer support class for locked objects.">locked_release</a>(pointer) {};
<a name="l01917"></a>01917 
<a name="l01922"></a><a class="code" href="a00067.html#a23647322b5c45034d4ccc523ef240ac9">01922</a>     <span class="keyword">inline</span> T&amp; <a class="code" href="a00067.html#a23647322b5c45034d4ccc523ef240ac9" title="Extract instance of locked typed object by pointer reference.">operator*</a>()<span class="keyword"> const</span>
<a name="l01923"></a>01923 <span class="keyword">        </span>{<span class="keywordflow">return</span> *(<span class="keyword">static_cast&lt;</span>T *<span class="keyword">&gt;</span>(<a class="code" href="a00069.html#a02d99a5b644dd18d77301c6475219382" title="locked object protected by locked_release">object</a>));};
<a name="l01924"></a>01924 
<a name="l01929"></a><a class="code" href="a00067.html#a95fac3b6e84c8e4b200b25c38c4d60bf">01929</a>     <span class="keyword">inline</span> T* <a class="code" href="a00067.html#a95fac3b6e84c8e4b200b25c38c4d60bf" title="Access member of instance of locked typed object by member reference.">operator-&gt;</a>()<span class="keyword"> const</span>
<a name="l01930"></a>01930 <span class="keyword">        </span>{<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(<a class="code" href="a00069.html#a02d99a5b644dd18d77301c6475219382" title="locked object protected by locked_release">object</a>);};
<a name="l01931"></a>01931 
<a name="l01936"></a><a class="code" href="a00067.html#a56d4155be20750268faced26ed5d9842">01936</a>     <span class="keyword">inline</span> T* <span class="keyword">get</span>(void) <span class="keyword">const</span>
<a name="l01937"></a>01937         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(<a class="code" href="a00069.html#a02d99a5b644dd18d77301c6475219382" title="locked object protected by locked_release">object</a>);};
<a name="l01938"></a>01938 };
<a name="l01939"></a>01939 
<a name="l01945"></a>01945 <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l01946"></a><a class="code" href="a00124.html">01946</a> <span class="keyword">class </span><a class="code" href="a00124.html" title="A templated smart pointer instance for shared singleton typed objects.">shared_instance</a> : <span class="keyword">public</span> <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>
<a name="l01947"></a>01947 {
<a name="l01948"></a>01948 <span class="keyword">public</span>:
<a name="l01952"></a><a class="code" href="a00124.html#a11e4c5c0c6a662e7044535eba735e191">01952</a>     <span class="keyword">inline</span> <a class="code" href="a00124.html#a11e4c5c0c6a662e7044535eba735e191" title="Construct empty instance to reference shared typed singleton.">shared_instance</a>() : <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>() {};
<a name="l01953"></a>01953 
<a name="l01959"></a><a class="code" href="a00124.html#a3c9292e98c3e41e60366c472493b1307">01959</a>     <span class="keyword">inline</span> <a class="code" href="a00124.html#a3c9292e98c3e41e60366c472493b1307" title="Construct shared access instance of shared typed singleton from matching shared_pointer.">shared_instance</a>(<a class="code" href="a00126.html" title="Templated shared pointer for singleton shared objects of specific type.">shared_pointer&lt;T&gt;</a> &amp;<a class="code" href="a00108.html" title="Generic smart pointer class.">pointer</a>) : <a class="code" href="a00127.html" title="Auto-pointer support class for shared singleton objects.">shared_release</a>(pointer) {};
<a name="l01960"></a>01960 
<a name="l01964"></a><a class="code" href="a00124.html#a4de738e9474f8527bae6896854ec89f0">01964</a>     <span class="keyword">inline</span> <span class="keyword">const</span> T&amp; <a class="code" href="a00124.html#a4de738e9474f8527bae6896854ec89f0" title="Access shared typed singleton object this instance locks and references.">operator*</a>()<span class="keyword"> const</span>
<a name="l01965"></a>01965 <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>(<a class="code" href="a00127.html#afbc5bedc3f622465083742cd2c14cc8a" title="Shared lock for protected singleton.">ptr</a>-&gt;pointer));};
<a name="l01966"></a>01966 
<a name="l01971"></a><a class="code" href="a00124.html#aaca54e388ac4b0643ac72a6700b43e6d">01971</a>     <span class="keyword">inline</span> <span class="keyword">const</span> T* <a class="code" href="a00124.html#aaca54e388ac4b0643ac72a6700b43e6d" title="Access member of shared typed singleton object this instance locks and references.">operator-&gt;</a>()<span class="keyword"> const</span>
<a name="l01972"></a>01972 <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>(<a class="code" href="a00127.html#afbc5bedc3f622465083742cd2c14cc8a" title="Shared lock for protected singleton.">ptr</a>-&gt;pointer);};
<a name="l01973"></a>01973 
<a name="l01978"></a><a class="code" href="a00124.html#aff534adda103782ea1095feda824b093">01978</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="l01979"></a>01979         {<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="a00127.html#afbc5bedc3f622465083742cd2c14cc8a" title="Shared lock for protected singleton.">ptr</a>-&gt;pointer);};
<a name="l01980"></a>01980 };
<a name="l01981"></a>01981 
<a name="l01988"></a>01988 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l01989"></a><a class="code" href="a00086.html">01989</a> <span class="keyword">class </span><a class="code" href="a00086.html" title="Typed smart locked pointer class.">mutex_pointer</a> : <span class="keyword">public</span> <a class="code" href="a00020.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>
<a name="l01990"></a>01990 {
<a name="l01991"></a>01991 <span class="keyword">public</span>:
<a name="l01995"></a><a class="code" href="a00086.html#a952d3b5cb3799c4b4312740f83a2ca51">01995</a>     <span class="keyword">inline</span> <a class="code" href="a00086.html#a952d3b5cb3799c4b4312740f83a2ca51" title="Create a pointer with no reference.">mutex_pointer</a>() : <a class="code" href="a00020.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>() {};
<a name="l01996"></a>01996 
<a name="l02001"></a><a class="code" href="a00086.html#a64faae9fab422a5cc5eac92456bc3b95">02001</a>     <span class="keyword">inline</span> <a class="code" href="a00086.html#a64faae9fab422a5cc5eac92456bc3b95" title="Create a pointer with a reference to a heap object.">mutex_pointer</a>(T* <span class="keywordtype">object</span>) : <a class="code" href="a00020.html" title="A mutex locked object smart pointer helper class.">auto_protect</a>(object) {};
<a name="l02002"></a>02002 
<a name="l02007"></a><a class="code" href="a00086.html#ae3444d9ccbbfd0c33b44a3eef81d1279">02007</a>     <span class="keyword">inline</span> T&amp; <a class="code" href="a00086.html#ae3444d9ccbbfd0c33b44a3eef81d1279" title="Reference object we are pointing to through pointer indirection.">operator*</a>()<span class="keyword"> const</span>
<a name="l02008"></a>02008 <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="l02009"></a>02009 
<a name="l02014"></a><a class="code" href="a00086.html#a23241f0b973b42886e645ed1c8943f8f">02014</a>     <span class="keyword">inline</span> T* <a class="code" href="a00086.html#a23241f0b973b42886e645ed1c8943f8f" title="Reference member of object we are pointing to.">operator-&gt;</a>()<span class="keyword"> const</span>
<a name="l02015"></a>02015 <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="l02016"></a>02016 
<a name="l02021"></a><a class="code" href="a00086.html#a7b636f610a9ac383638d67b3d096f5ec">02021</a>     <span class="keyword">inline</span> T* <span class="keyword">get</span>(void) <span class="keyword">const</span>
<a name="l02022"></a>02022         {<span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T*<span class="keyword">&gt;</span>(auto_protect::object);};
<a name="l02023"></a>02023 };
<a name="l02024"></a>02024 
<a name="l02030"></a><a class="code" href="a00200.html#af918d5bcdf14569774aa2c0b87bad662">02030</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#af918d5bcdf14569774aa2c0b87bad662" title="Convenience function to start a joinable thread.">start</a>(<a class="code" href="a00052.html" title="A child thread object that may be joined by parent.">JoinableThread</a> *thread, <span class="keywordtype">int</span> priority = 0)
<a name="l02031"></a>02031     {thread-&gt;<a class="code" href="a00052.html#a73e54d72cdec7c213217848f4941d9a0" title="Start execution of child context.">start</a>(priority);}
<a name="l02032"></a>02032 
<a name="l02038"></a><a class="code" href="a00200.html#a170315d19c5f59cfc49fd7ed56f91ced">02038</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#af918d5bcdf14569774aa2c0b87bad662" title="Convenience function to start a joinable thread.">start</a>(<a class="code" href="a00043.html" title="A detached thread object that is stand-alone.">DetachedThread</a> *thread, <span class="keywordtype">int</span> priority = 0)
<a name="l02039"></a>02039     {thread-&gt;<a class="code" href="a00043.html#af041e36cd05dae4d4e651e3880afd067" title="Start execution of detached context.">start</a>(priority);}
<a name="l02040"></a>02040 
<a name="l02044"></a><a class="code" href="a00200.html#acf127b779836b88484404efc87a67e10">02044</a> <span class="keyword">typedef</span> <a class="code" href="a00036.html" title="An optimized and convertable shared lock.">ConditionalLock</a> <a class="code" href="a00200.html#acf127b779836b88484404efc87a67e10" title="Convenience type for using conditional locks.">condlock_t</a>;
<a name="l02045"></a>02045 
<a name="l02049"></a><a class="code" href="a00200.html#a03f3cb06e16ab47441fccc43ce476980">02049</a> <span class="keyword">typedef</span> <a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">ConditionalAccess</a> <a class="code" href="a00200.html#a03f3cb06e16ab47441fccc43ce476980" title="Convenience type for scheduling access.">accesslock_t</a>;
<a name="l02050"></a>02050 
<a name="l02054"></a><a class="code" href="a00200.html#affd70d65c0baeb922d2ca671872e7f53">02054</a> <span class="keyword">typedef</span> <a class="code" href="a00160.html" title="Event notification to manage scheduled realtime threads.">TimedEvent</a> <a class="code" href="a00200.html#affd70d65c0baeb922d2ca671872e7f53" title="Convenience type for using timed events.">timedevent_t</a>;
<a name="l02055"></a>02055 
<a name="l02059"></a><a class="code" href="a00200.html#a138164254602ef7e6e53c350773313d8">02059</a> <span class="keyword">typedef</span> <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a> <a class="code" href="a00200.html#a138164254602ef7e6e53c350773313d8" title="Convenience type for using exclusive mutex locks.">mutex_t</a>;
<a name="l02060"></a>02060 
<a name="l02065"></a><a class="code" href="a00200.html#ab04b91fb5650b11891fbe66b1f4d052b">02065</a> <span class="keyword">typedef</span> <a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a> <a class="code" href="a00200.html#ab04b91fb5650b11891fbe66b1f4d052b" title="Convenience type for using exclusive mutex on systems which define &amp;quot;mutex&amp;quot; (solaris) alread...">Mutex</a>;
<a name="l02066"></a>02066 
<a name="l02070"></a><a class="code" href="a00200.html#a5c45025321ab898048083a82ab03128b">02070</a> <span class="keyword">typedef</span> <a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock</a> <a class="code" href="a00200.html#a5c45025321ab898048083a82ab03128b" title="Convenience type for using read/write locks.">rwlock_t</a>;
<a name="l02071"></a>02071 
<a name="l02075"></a><a class="code" href="a00200.html#a0ad9997646945f285a2f13ae0d1356e9">02075</a> <span class="keyword">typedef</span> <a class="code" href="a00114.html" title="Portable recursive exclusive lock.">rexlock</a> <a class="code" href="a00200.html#a0ad9997646945f285a2f13ae0d1356e9" title="Convenience type for using recursive exclusive locks.">rexlock_t</a>;
<a name="l02076"></a>02076 
<a name="l02080"></a><a class="code" href="a00200.html#abe527be2b7ae220411b9edc51e1d8428">02080</a> <span class="keyword">typedef</span> <a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a> <a class="code" href="a00200.html#abe527be2b7ae220411b9edc51e1d8428" title="Convenience type for using counting semaphores.">semaphore_t</a>;
<a name="l02081"></a>02081 
<a name="l02085"></a><a class="code" href="a00200.html#a87bea21ba776b68b3c6684aec37f0073">02085</a> <span class="keyword">typedef</span> <a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a> <a class="code" href="a00200.html#a87bea21ba776b68b3c6684aec37f0073" title="Convenience type for using thread barriers.">barrier_t</a>;
<a name="l02086"></a>02086 
<a name="l02091"></a><a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30">02091</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier_t</a> &amp;<a class="code" href="a00022.html" title="A portable implimentation of &amp;quot;barrier&amp;quot; thread sychronization.">barrier</a>)
<a name="l02092"></a>02092     {barrier.<a class="code" href="a00022.html#a97f3b020a0d0c59c78f1933e84da908e" title="Wait at the barrier until the count of threads waiting is reached.">wait</a>();}
<a name="l02093"></a>02093 
<a name="l02099"></a><a class="code" href="a00200.html#a0327ce5545cdeb7f08c28914e4aa274c">02099</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a0b5e5fb8adfa3f19342304537316af30" title="Convenience function to wait on a barrier.">wait</a>(<a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore_t</a> &amp;<a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a>, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>)
<a name="l02100"></a>02100     {semaphore.<a class="code" href="a00120.html#af0e430d192c44be1d65f5a4fd8cb91a4" title="Wait until the semphore usage count is less than the thread limit.">wait</a>(timeout);}
<a name="l02101"></a>02101 
<a name="l02106"></a><a class="code" href="a00200.html#a0278df3a81194f303fd9066c1aec6a75">02106</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore_t</a> &amp;<a class="code" href="a00120.html" title="A portable counting semaphore class.">semaphore</a>)
<a name="l02107"></a>02107     {semaphore.<a class="code" href="a00120.html#ad845afe88e4360a3c4dc425c32255200" title="Release the semaphore after waiting for it.">release</a>();}
<a name="l02108"></a>02108 
<a name="l02113"></a><a class="code" href="a00200.html#a05e1c5a08bac3a310247fe41ad996efc">02113</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a05e1c5a08bac3a310247fe41ad996efc" title="Convenience function to acquire a mutex.">acquire</a>(<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex_t</a> &amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>)
<a name="l02114"></a>02114     {mutex.<a class="code" href="a00084.html#a5d3b8bc911438e7ae7c2f4f84f0bd854" title="Acquire mutex lock.">lock</a>();}
<a name="l02115"></a>02115 
<a name="l02120"></a><a class="code" href="a00200.html#ab313bb8bef9848a83d01f2f6cb1eeba1">02120</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex_t</a> &amp;<a class="code" href="a00084.html" title="Generic non-recursive exclusive lock class.">mutex</a>)
<a name="l02121"></a>02121     {mutex.<a class="code" href="a00084.html#a210b7d6293efc693d5a72f24553eea07" title="Release acquired lock.">release</a>();}
<a name="l02122"></a>02122 
<a name="l02127"></a><a class="code" href="a00200.html#aaaeabbd959a07e91ff1e0bfabf25f600">02127</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#aaaeabbd959a07e91ff1e0bfabf25f600" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02128"></a>02128     {lock.<a class="code" href="a00035.html#a1f3c9b6430890905b2ed7afa6aac5be7" title="Exclusive mode write thread scheduling.">modify</a>();}
<a name="l02129"></a>02129 
<a name="l02134"></a><a class="code" href="a00200.html#a3eb9636540924749fa96cfdd94d8170c">02134</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#af11d6983ce975637031c6eaa0b8cf621" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02135"></a>02135     {lock.<a class="code" href="a00035.html#acaa6653b643ee9afb5a106690c5efe3e" title="Access mode shared thread scheduling.">access</a>();}
<a name="l02136"></a>02136 
<a name="l02141"></a><a class="code" href="a00200.html#a1e29738a03c9a3a9875c320655aa92e7">02141</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" 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="a00035.html#ad78d46dc0992b34b27c13cf18b32b8b3" title="Release access mode read scheduling.">release</a>();}
<a name="l02143"></a>02143 
<a name="l02149"></a><a class="code" href="a00200.html#a1cba76e7b293fb1dd2a1606a7d24a125">02149</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a1cba76e7b293fb1dd2a1606a7d24a125" title="Convenience function to commit an exclusive access lock.">commit</a>(<a class="code" href="a00035.html" title="The conditional rw seperates scheduling for optizming behavior or rw locks.">accesslock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02150"></a>02150     {lock.<a class="code" href="a00035.html#a926c3327686f18ee701775c606eae79d" title="Complete exclusive mode write scheduling.">commit</a>();}
<a name="l02151"></a>02151 
<a name="l02156"></a><a class="code" href="a00200.html#a4105af822d5d89bc20f86ce72c7a21c7">02156</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a740cc90f6867eb29e34a0efa0dddad40" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02157"></a>02157     {lock.<a class="code" href="a00036.html#a28a21a8f2735f8e1f2f6685f27e97a5a" title="Convert read lock into exclusive (write/modify) access.">exclusive</a>();}
<a name="l02158"></a>02158 
<a name="l02163"></a><a class="code" href="a00200.html#ae6d6afe2a776ed45576b62ccc9c4d34f">02163</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#aaa965208b479b06deb044874e4a86b42" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol.">share</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" 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="a00036.html#aeaef77545588f04d19552225a47abf6b" title="Return an exclusive access lock back to share mode.">share</a>();}
<a name="l02165"></a>02165 
<a name="l02170"></a><a class="code" href="a00200.html#a700d8d90f846ff3aeb7830b1af681895">02170</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#aaaeabbd959a07e91ff1e0bfabf25f600" title="Convenience function to exclusively schedule conditional access.">modify</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" 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="a00036.html#a31a992f0f164d87a1c84ea523fe117d9" title="Acquire write (exclusive modify) lock.">modify</a>();}
<a name="l02172"></a>02172 
<a name="l02178"></a><a class="code" href="a00200.html#af15bb1493495b5cd6882177d33a8531e">02178</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00200.html#a1cba76e7b293fb1dd2a1606a7d24a125" title="Convenience function to commit an exclusive access lock.">commit</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02179"></a>02179     {lock.<a class="code" href="a00036.html#adcc16bc122c4b84547caf25cc804a14d" title="Commit changes / release a modify lock.">commit</a>();}
<a name="l02180"></a>02180 
<a name="l02185"></a><a class="code" href="a00200.html#ac9cd5155bc185b5c068d2bb6f617f70b">02185</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#af11d6983ce975637031c6eaa0b8cf621" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02186"></a>02186     {lock.<a class="code" href="a00036.html#aa6e6f2a43d99dd68a75ce0e5e304d62b" title="Acquire access (shared read) lock.">access</a>();}
<a name="l02187"></a>02187 
<a name="l02192"></a><a class="code" href="a00200.html#ac50619b8d168c676295f9ba0c39dcbda">02192</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00036.html" title="An optimized and convertable shared lock.">condlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" 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="a00036.html#abd12452d2b279c589ac24d8c35a55232" title="Release a shared lock.">release</a>();}
<a name="l02194"></a>02194 
<a name="l02200"></a><a class="code" href="a00200.html#ad3e205ed6cc3e4067784743e6c009f7f">02200</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00176.html#a740cc90f6867eb29e34a0efa0dddad40" title="Convenience function to exclusive lock shared object through it&amp;#39;s protocol.">exclusive</a>(<a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>)
<a name="l02201"></a>02201     {<span class="keywordflow">return</span> lock.<a class="code" href="a00115.html#ae17f207aea46577f3be10d68f3f8db99" title="Request modify (write) access through the lock.">modify</a>(timeout);}
<a name="l02202"></a>02202 
<a name="l02208"></a><a class="code" href="a00200.html#af6054d50bb295cc06a354496487ba779">02208</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="a00176.html#aaa965208b479b06deb044874e4a86b42" title="Convenience function to restore shared locking for object through it&amp;#39;s protocol.">share</a>(<a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = <a class="code" href="a00161.html#ac8693306626aab9c874b912525c3de7b" title="A value to use for infinite time.">Timer::inf</a>)
<a name="l02209"></a>02209     {<span class="keywordflow">return</span> lock.<a class="code" href="a00115.html#a536e267f130b0e7afe7f0da61f6d458c" title="Request shared (read) access through the lock.">access</a>(timeout);}
<a name="l02210"></a>02210 
<a name="l02215"></a><a class="code" href="a00200.html#affdc6ed4dd84bb4218afd714beb68b34">02215</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<a class="code" href="a00115.html" title="A generic and portable implimentation of Read/Write locking.">rwlock_t</a> &amp;<a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02216"></a>02216     {lock.<a class="code" href="a00115.html#aa4ffe032a42426585b5612f580e4c971" title="Release an arbitrary object that has been protected by a rwlock.">release</a>();}
<a name="l02217"></a>02217 
<a name="l02222"></a><a class="code" href="a00200.html#ab1558839718706854b73d53777b0a183">02222</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" 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="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" title="Convenience function to exclusively lock an object through it&amp;#39;s protocol.">lock</a>)
<a name="l02223"></a>02223     {lock.<a class="code" href="a00114.html#a9456447d47799fd2204c4f99dc772fb8" title="Acquire or increase locking.">lock</a>();}
<a name="l02224"></a>02224 
<a name="l02229"></a><a class="code" href="a00200.html#a5f89101273a0b3635e76f2363f1cc34f">02229</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" 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="a00176.html#a56d42d6338a789cc7ef9ed4f411e00e5" 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="a00114.html#aa5eeed602dcb295a59737d4c5269c903" title="Release or decrease locking.">release</a>();}
<a name="l02231"></a>02231 
<a name="l02232"></a>02232 END_NAMESPACE
<a name="l02233"></a>02233 
<a name="l02234"></a>02234 <span class="preprocessor">#define ENTER_EXCLUSIVE \</span>
<a name="l02235"></a>02235 <span class="preprocessor">    do { static pthread_mutex_t __sync__ = PTHREAD_MUTEX_INITIALIZER; \</span>
<a name="l02236"></a>02236 <span class="preprocessor">        pthread_mutex_lock(&amp;__sync__);</span>
<a name="l02237"></a>02237 <span class="preprocessor"></span>
<a name="l02238"></a>02238 <span class="preprocessor">#define LEAVE_EXCLUSIVE \</span>
<a name="l02239"></a>02239 <span class="preprocessor">    pthread_mutex_unlock(&amp;__sync__);} while(0);</span>
<a name="l02240"></a>02240 <span class="preprocessor"></span>
<a name="l02241"></a>02241 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00200.html">thread.h</a>      </li>
      <li class="footer">Generated on Wed Apr 13 2011 22:39:47 for ucommon by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>

</body>
</html>