Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > ed376d6842ea322c25405e7c23b3bc12 > files > 274

libcommoncpp-devel-1.8.0-5.1mdv2010.1.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>GNU CommonC++: ost::MutexLock Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceost.html">ost</a>::<a class="el" href="classost_1_1_mutex_lock.html">MutexLock</a>
  </div>
</div>
<div class="contents">
<h1>ost::MutexLock Class Reference</h1><!-- doxytag: class="ost::MutexLock" -->
<p>The <a class="el" href="classost_1_1_mutex_lock.html" title="The MutexLock class is used to protect a section of code so that at any given time...">MutexLock</a> class is used to protect a section of code so that at any given time only a single thread can perform the protected operation.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="thread_8h_source.html">thread.h</a>&gt;</code></p>

<p><a href="classost_1_1_mutex_lock-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_lock.html#aedb21cfad9b0f1200d055fb69efa2546">MutexLock</a> (<a class="el" href="classost_1_1_mutex.html">Mutex</a> &amp;_mutex)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Acquire the mutex.  <a href="#aedb21cfad9b0f1200d055fb69efa2546"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_lock.html#a58bba3406d89b40c8bd3e9ac389b920c">~MutexLock</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release the mutex automatically.  <a href="#a58bba3406d89b40c8bd3e9ac389b920c"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>The <a class="el" href="classost_1_1_mutex_lock.html" title="The MutexLock class is used to protect a section of code so that at any given time...">MutexLock</a> class is used to protect a section of code so that at any given time only a single thread can perform the protected operation. </p>
<p>It use <a class="el" href="classost_1_1_mutex.html" title="The Mutex class is used to protect a section of code so that at any given time only...">Mutex</a> to protect operation. Using this class is usefull and exception safe. The mutex that has been locked is automatically released when the function call stack falls out of scope, so one doesnt have to remember to unlock the mutex at each function return.</p>
<p>A common use is</p>
<p>void func_to_protect() { <a class="el" href="classost_1_1_mutex_lock.html" title="The MutexLock class is used to protect a section of code so that at any given time...">MutexLock</a> lock(mutex); ... operation ... }</p>
<p>NOTE: do not declare variable as "MutexLock (mutex)", the mutex will be released at statement end.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Frediano Ziglio &lt;<a href="mailto:freddy77@angelfire.com">freddy77@angelfire.com</a>&gt; <a class="el" href="classost_1_1_mutex.html" title="The Mutex class is used to protect a section of code so that at any given time only...">Mutex</a> automatic locker for protected access. </dd></dl>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aedb21cfad9b0f1200d055fb69efa2546"></a><!-- doxytag: member="ost::MutexLock::MutexLock" ref="aedb21cfad9b0f1200d055fb69efa2546" args="(Mutex &amp;_mutex)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ost::MutexLock::MutexLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classost_1_1_mutex.html">Mutex</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>_mutex</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Acquire the mutex. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_mutex</em>&nbsp;</td><td>reference to mutex to aquire. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a58bba3406d89b40c8bd3e9ac389b920c"></a><!-- doxytag: member="ost::MutexLock::~MutexLock" ref="a58bba3406d89b40c8bd3e9ac389b920c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ost::MutexLock::~MutexLock </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Release the mutex automatically. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="thread_8h_source.html">thread.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Nov 12 09:55:47 2010 for GNU CommonC++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>