Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b293cf61b174f6cb974e48c9096dc9b3 > files > 252

lib64commoncpp-devel-1.8.1-7.mga4.x86_64.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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>GNU CommonC++: ost::MutexLock Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">GNU CommonC++
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <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 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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceost.html">ost</a></li><li class="navelem"><a class="el" href="classost_1_1_mutex_lock.html">MutexLock</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classost_1_1_mutex_lock-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ost::MutexLock Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<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 only a single thre...">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="classost_1_1_mutex_lock.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="thread_8h_source.html">thread.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aedb21cfad9b0f1200d055fb69efa2546"><td class="memItemLeft" align="right" valign="top">&#160;</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 class="memdesc:aedb21cfad9b0f1200d055fb69efa2546"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire the mutex.  <a href="#aedb21cfad9b0f1200d055fb69efa2546">More...</a><br/></td></tr>
<tr class="separator:aedb21cfad9b0f1200d055fb69efa2546"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58bba3406d89b40c8bd3e9ac389b920c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_mutex_lock.html#a58bba3406d89b40c8bd3e9ac389b920c">~MutexLock</a> ()</td></tr>
<tr class="memdesc:a58bba3406d89b40c8bd3e9ac389b920c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release the mutex automatically.  <a href="#a58bba3406d89b40c8bd3e9ac389b920c">More...</a><br/></td></tr>
<tr class="separator:a58bba3406d89b40c8bd3e9ac389b920c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><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 only a single thre...">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 a single thread c...">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 only a single thre...">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="section author"><dt>Author</dt><dd>Frediano Ziglio <a href="#" onclick="location.href='mai'+'lto:'+'fre'+'dd'+'y77'+'@a'+'nge'+'lf'+'ire'+'.c'+'om'; return false;">fredd<span style="display: none;">.nosp@m.</span>y77@<span style="display: none;">.nosp@m.</span>angel<span style="display: none;">.nosp@m.</span>fire<span style="display: none;">.nosp@m.</span>.com</a> <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 a single thread c...">Mutex</a> automatic locker for protected access. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aedb21cfad9b0f1200d055fb69efa2546"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <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;&#160;</td>
          <td class="paramname"><em>_mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Acquire the mutex. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">_mutex</td><td>reference to mutex to aquire. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a58bba3406d89b40c8bd3e9ac389b920c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ost::MutexLock::~MutexLock </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </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><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 17 2013 23:24:58 for GNU CommonC++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>