Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 5b095c1dcccf87f92298aa569e0d8cd3 > files > 105

globus-common-doc-14.10-2.fc18.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<!-- THIS FILE IS AUTOMATICALLY GENERATED FROM THE GLOBUS SOURCE CODE
     DO NOT MODIFY.
-->
<title>Globus Reference Manual</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.8.3.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__globus__mutex.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Mutual Exclusion<div class="ingroups"><a class="el" href="group__globus__thread.html">Threading</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Collaboration diagram for Mutual Exclusion:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group__globus__mutex.png" border="0" alt="" usemap="#group____globus____mutex"/>
<map name="group____globus____mutex" id="group____globus____mutex">
<area shape="rect" id="node1" href="group__globus__thread.html" title="The Globus runtime includes support for portably creating threads on POSIX and Windows systems..." alt="" coords="6,5,85,32"/></map>
</td></tr></table></center>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionglobus__mutexattr__t.html">globus_mutexattr_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga393b167864ed6de6974e6531e18c49f7"><td class="memItemLeft" align="right" valign="top">typedef int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga393b167864ed6de6974e6531e18c49f7">globus_rmutexattr_t</a></td></tr>
<tr class="separator:ga393b167864ed6de6974e6531e18c49f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga3ff7b5a88fc262ec7751db6b7ffce13f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga3ff7b5a88fc262ec7751db6b7ffce13f">globus_mutex_init</a> (<a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *mutex, <a class="el" href="unionglobus__mutexattr__t.html">globus_mutexattr_t</a> *attr)</td></tr>
<tr class="separator:ga3ff7b5a88fc262ec7751db6b7ffce13f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9417e7b0f8c9ca048585f68f8abbc9b8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga9417e7b0f8c9ca048585f68f8abbc9b8">globus_mutex_destroy</a> (<a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *mutex)</td></tr>
<tr class="separator:ga9417e7b0f8c9ca048585f68f8abbc9b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga053b5f9b263f11b7305efdbee881bf5d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga053b5f9b263f11b7305efdbee881bf5d">globus_mutex_lock</a> (<a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *mutex)</td></tr>
<tr class="separator:ga053b5f9b263f11b7305efdbee881bf5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8074266ebb8c3359a6078ffe654cc531"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga8074266ebb8c3359a6078ffe654cc531">globus_mutex_unlock</a> (<a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *mutex)</td></tr>
<tr class="separator:ga8074266ebb8c3359a6078ffe654cc531"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga796547c088462e8c35ef87e279d27fb8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga796547c088462e8c35ef87e279d27fb8">globus_mutex_trylock</a> (<a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *mutex)</td></tr>
<tr class="separator:ga796547c088462e8c35ef87e279d27fb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae5763a14b7f8f8b1f8372394e162d2ef"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#gae5763a14b7f8f8b1f8372394e162d2ef">globus_mutexattr_init</a> (<a class="el" href="unionglobus__mutexattr__t.html">globus_mutexattr_t</a> *attr)</td></tr>
<tr class="separator:gae5763a14b7f8f8b1f8372394e162d2ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaabcb4021e84485c4c4cbd20ce5771393"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#gaabcb4021e84485c4c4cbd20ce5771393">globus_mutexattr_destroy</a> (<a class="el" href="unionglobus__mutexattr__t.html">globus_mutexattr_t</a> *attr)</td></tr>
<tr class="separator:gaabcb4021e84485c4c4cbd20ce5771393"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
Recursive Mutex</h2></td></tr>
<tr class="memitem:gaa72a6972fef363a21bf49b743f37333d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#gaa72a6972fef363a21bf49b743f37333d">globus_rmutex_init</a> (<a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *rmutex, <a class="el" href="group__globus__mutex.html#ga393b167864ed6de6974e6531e18c49f7">globus_rmutexattr_t</a> *rattr)</td></tr>
<tr class="separator:gaa72a6972fef363a21bf49b743f37333d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e104ab44374ecd4a4e5127889da2df5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga0e104ab44374ecd4a4e5127889da2df5">globus_rmutex_lock</a> (<a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *rmutex)</td></tr>
<tr class="separator:ga0e104ab44374ecd4a4e5127889da2df5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga426c89b89ff57098b98fe5fd5730fd0a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga426c89b89ff57098b98fe5fd5730fd0a">globus_rmutex_unlock</a> (<a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *rmutex)</td></tr>
<tr class="separator:ga426c89b89ff57098b98fe5fd5730fd0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga15128a4a5ad759025ca7194b4fabc295"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__globus__mutex.html#ga15128a4a5ad759025ca7194b4fabc295">globus_rmutex_destroy</a> (<a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *rmutex)</td></tr>
<tr class="separator:ga15128a4a5ad759025ca7194b4fabc295"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The Globus runtime includes three portable, related mutual exclusion primitives that can be used in applications and libraries. These are</p>
<ul>
<li><a class="el" href="unionglobus__mutex__t.html" title="Mutex.">globus_mutex_t</a>: a non-recursive, non-shared lock</li>
<li><a class="el" href="structglobus__rmutex__t.html" title="Recursive Mutex.">globus_rmutex_t</a>: a recursive non-shared lock</li>
<li>globus_rw_mutex_t: a reader-writer lock </li>
</ul>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga393b167864ed6de6974e6531e18c49f7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int <a class="el" href="group__globus__mutex.html#ga393b167864ed6de6974e6531e18c49f7">globus_rmutexattr_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Recursive mutex attribute. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga3ff7b5a88fc262ec7751db6b7ffce13f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_mutex_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *&#160;</td>
          <td class="paramname"><em>mutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="unionglobus__mutexattr__t.html">globus_mutexattr_t</a> *&#160;</td>
          <td class="paramname"><em>attr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a mutex. </p>
<p>The <a class="el" href="group__globus__mutex.html#ga3ff7b5a88fc262ec7751db6b7ffce13f" title="Initialize a mutex.">globus_mutex_init()</a> function creates a mutex variable that can be used for synchronization. Currently, the <em>attr</em> parameter is ignored.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>Pointer to the mutex to initialize. </td></tr>
    <tr><td class="paramname">attr</td><td>Ignored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, <a class="el" href="group__globus__mutex.html#ga3ff7b5a88fc262ec7751db6b7ffce13f" title="Initialize a mutex.">globus_mutex_init()</a> initializes the mutex and returns GLOBUS_SUCCESS. Otherwise, a non-0 value is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="ga9417e7b0f8c9ca048585f68f8abbc9b8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_mutex_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a mutex. </p>
<pre class="fragment">The globus_mutex_destroy() function destroys the mutex pointed to by its
@a mutex parameter. After a mutex is destroyed it may no longer be used
unless it is again initialized by globus_mutex_init(). Behavior is
undefined if globus_mutex_destroy() is called with a pointer to a locked
mutex.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>The mutex to destroy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, <a class="el" href="group__globus__mutex.html#ga9417e7b0f8c9ca048585f68f8abbc9b8" title="Destroy a mutex.">globus_mutex_destroy()</a> returns GLOBUS_SUCCESS. Otherwise, a non-zero implementation-specific error value is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="ga053b5f9b263f11b7305efdbee881bf5d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_mutex_lock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Lock a mutex. </p>
<pre class="fragment">The globus_mutex_lock() function locks the mutex pointed to by its
@a mutex parameter.
Upon successful
return, the thread calling globus_mutex_lock() has an exclusive 
lock on the resources protected by @a mutex. Other threads calling
globus_mutex_lock() will wait until that thread later calls
globus_mutex_unlock() or globus_cond_wait() with that mutex. Depending
on the thread model, calling globus_mutex_lock on a mutex locked
by the current thread will either return an error or result in deadlock.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>The mutex to lock. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, <a class="el" href="group__globus__mutex.html#ga053b5f9b263f11b7305efdbee881bf5d" title="Lock a mutex.">globus_mutex_lock()</a> returns GLOBUS_SUCCESS. Otherwise, a non-zero implementation-specific error value is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="ga8074266ebb8c3359a6078ffe654cc531"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_mutex_unlock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unlock a mutex. </p>
<pre class="fragment">The globus_mutex_unlock() function unlocks the mutex pointed to by its
@a mutex parameter.  Upon successful
return, the thread calling globus_mutex_unlock() no longer has an
exclusive lock on the resources protected by @a mutex. Another thread
calling globus_mutex_lock() may be unblocked so that it may acquire
the mutex. Behavior is undefined if globus_mutex_unlock is called with
an unlocked mutex.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>The mutex to unlock. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, <a class="el" href="group__globus__mutex.html#ga8074266ebb8c3359a6078ffe654cc531" title="Unlock a mutex.">globus_mutex_unlock()</a> returns GLOBUS_SUCCESS. Otherwise, a non-zero implementation-specific error value is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="ga796547c088462e8c35ef87e279d27fb8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_mutex_trylock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__mutex__t.html">globus_mutex_t</a> *&#160;</td>
          <td class="paramname"><em>mutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Lock a mutex if it is not locked. </p>
<pre class="fragment">The globus_mutex_trylock() function locks the mutex pointed to by its
@a mutex parameter if no thread has already locked the mutex. If 
@a mutex is locked, then globus_mutex_trylock() returns EBUSY and does
not block the current thread or lock the mutex.  Upon successful
return, the thread calling globus_mutex_trylock() has an exclusive 
lock on the resources protected by @a mutex. Other threads calling
globus_mutex_lock() will wait until that thread later calls
globus_mutex_unlock() or globus_cond_wait() with that mutex. 
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mutex</td><td>The mutex to lock. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, <a class="el" href="group__globus__mutex.html#ga796547c088462e8c35ef87e279d27fb8" title="Lock a mutex if it is not locked.">globus_mutex_trylock()</a> returns GLOBUS_SUCCESS and locks the mutex. If another thread holds the lock, <a class="el" href="group__globus__mutex.html#ga796547c088462e8c35ef87e279d27fb8" title="Lock a mutex if it is not locked.">globus_mutex_trylock()</a> returns EBUSY. Otherwise, a non-zero implementation-specific error value is returned. </dd></dl>

</div>
</div>
<a class="anchor" id="gae5763a14b7f8f8b1f8372394e162d2ef"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_mutexattr_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__mutexattr__t.html">globus_mutexattr_t</a> *&#160;</td>
          <td class="paramname"><em>attr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a mutex attribute. </p>
<pre class="fragment">The globus_mutexattr_init() function initializes the mutex attribute
structure pointed to by its @a attr parameter. Currently there are
no attribute values that can be set via this API, so there's no real
use to calling this function.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">attr</td><td>Attribute structure to initialize.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Upon success, <a class="el" href="group__globus__mutex.html#gae5763a14b7f8f8b1f8372394e162d2ef" title="Initialize a mutex attribute.">globus_mutexattr_init()</a> returns GLOBUS_SUCCESS and modifies the attribute pointed to by <em>attr</em>. If an error occurs, <a class="el" href="group__globus__mutex.html#gae5763a14b7f8f8b1f8372394e162d2ef" title="Initialize a mutex attribute.">globus_mutexattr_init()</a> returns an implementation-specific non-zero error code. </dd></dl>

</div>
</div>
<a class="anchor" id="gaabcb4021e84485c4c4cbd20ce5771393"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_mutexattr_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__mutexattr__t.html">globus_mutexattr_t</a> *&#160;</td>
          <td class="paramname"><em>attr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a mutex attribute. </p>
<pre class="fragment">The globus_mutexattr_destroy() function destroys the mutex attribute
structure pointed to by its @a attr parameter. 
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">attr</td><td>Attribute structure to destroy.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Upon success, <a class="el" href="group__globus__mutex.html#gaabcb4021e84485c4c4cbd20ce5771393" title="Destroy a mutex attribute.">globus_mutexattr_destroy()</a> returns GLOBUS_SUCCESS and modifies the attribute pointed to by <em>attr</em>. If an error occurs, <a class="el" href="group__globus__mutex.html#gaabcb4021e84485c4c4cbd20ce5771393" title="Destroy a mutex attribute.">globus_mutexattr_destroy()</a> returns an implementation-specific non-zero error code. </dd></dl>

</div>
</div>
<a class="anchor" id="gaa72a6972fef363a21bf49b743f37333d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_rmutex_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *&#160;</td>
          <td class="paramname"><em>rmutex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__globus__mutex.html#ga393b167864ed6de6974e6531e18c49f7">globus_rmutexattr_t</a> *&#160;</td>
          <td class="paramname"><em>rattr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a recursive mutex. </p>
<pre class="fragment">The globus_rmutex_init() function initializes a recursive mutex,
that is, one which may be locked multiple times by a single thread
without causing deadlock.
</pre> <dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rmutex</td><td>A pointer to the mutex to initialize </td></tr>
    <tr><td class="paramname">rattr</td><td>IGNORED</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, <a class="el" href="group__globus__mutex.html#gaa72a6972fef363a21bf49b743f37333d" title="Initialize a recursive mutex.">globus_rmutex_init()</a> initializes the mutex and returns GLOBUS_SUCCESS; otherwise, it returns a non-zero error code. </dd></dl>

<p>References <a class="el" href="group__globus__cond.html#ga1c074938c3f7c436bb6c3248a698533a">globus_cond_init()</a>, <a class="el" href="group__globus__mutex.html#ga9417e7b0f8c9ca048585f68f8abbc9b8">globus_mutex_destroy()</a>, and <a class="el" href="group__globus__mutex.html#ga3ff7b5a88fc262ec7751db6b7ffce13f">globus_mutex_init()</a>.</p>

</div>
</div>
<a class="anchor" id="ga0e104ab44374ecd4a4e5127889da2df5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_rmutex_lock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *&#160;</td>
          <td class="paramname"><em>rmutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Lock a recursive mutex. </p>
<pre class="fragment">The globus_rmutex_lock() function acquires the lock controlled by
@a rmutex. This may be called multiple times in a single thread without 
causing deadlock, provided that a call to globus_rmutex_unlock() is
called the same number of times as globus_rmutex_lock(). Once acquired,
all other threads calling this function will be blocked until the
mutex is completely unlocked.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rmutex</td><td>A pointer to the mutex to lock</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>On success, <a class="el" href="group__globus__mutex.html#gaa72a6972fef363a21bf49b743f37333d" title="Initialize a recursive mutex.">globus_rmutex_init()</a> increases the lock level for the mutex, blocks other threads trying to acquire the same mutex, and returns GLOBUS_SUCCESS; otherwise, it returns a non-zero error code. </dd></dl>

<p>References <a class="el" href="group__globus__cond.html#ga9b58106e5b1b2545ab45db0e3e4f98b0">globus_cond_wait()</a>, <a class="el" href="group__globus__mutex.html#ga053b5f9b263f11b7305efdbee881bf5d">globus_mutex_lock()</a>, <a class="el" href="group__globus__mutex.html#ga8074266ebb8c3359a6078ffe654cc531">globus_mutex_unlock()</a>, <a class="el" href="group__globus__thread.html#ga0858d6945cc5ed82cec65eadd2ef0a32">globus_thread_equal()</a>, and <a class="el" href="group__globus__thread.html#ga0075f9c3c3c1e2a2eb41a10913ccfca6">globus_thread_self()</a>.</p>

</div>
</div>
<a class="anchor" id="ga426c89b89ff57098b98fe5fd5730fd0a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_rmutex_unlock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *&#160;</td>
          <td class="paramname"><em>rmutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unlock a recursive mutex. </p>
<pre class="fragment">The globus_rmutex_unlock() function decrements the lock count for
the lock pointed to by @a rmutex. If the lock count is reduced to
zero, it also unblocks a thread which is trying to acquire the lock
if there is one.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rmutex</td><td>Mutex to unlock</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>GLOBUS_SUCCESS </dd></dl>

<p>References <a class="el" href="group__globus__cond.html#ga05a56b1f671782a6a2c0d2c72292dd47">globus_cond_signal()</a>, <a class="el" href="group__globus__mutex.html#ga053b5f9b263f11b7305efdbee881bf5d">globus_mutex_lock()</a>, <a class="el" href="group__globus__mutex.html#ga8074266ebb8c3359a6078ffe654cc531">globus_mutex_unlock()</a>, <a class="el" href="group__globus__thread.html#ga0858d6945cc5ed82cec65eadd2ef0a32">globus_thread_equal()</a>, and <a class="el" href="group__globus__thread.html#ga0075f9c3c3c1e2a2eb41a10913ccfca6">globus_thread_self()</a>.</p>

</div>
</div>
<a class="anchor" id="ga15128a4a5ad759025ca7194b4fabc295"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_rmutex_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structglobus__rmutex__t.html">globus_rmutex_t</a> *&#160;</td>
          <td class="paramname"><em>rmutex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a recursive mutex. </p>
<pre class="fragment">The globus_rmutex_destroy() function destroys a recursive mutex
If the mutex is currently locked, behavior is undefined.
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rmutex</td><td>Mutex to unlock</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>GLOBUS_SUCCESS </dd></dl>

<p>References <a class="el" href="group__globus__cond.html#ga4eb0f26fc152d2c2ec956cfde24e4190">globus_cond_destroy()</a>, and <a class="el" href="group__globus__mutex.html#ga9417e7b0f8c9ca048585f68f8abbc9b8">globus_mutex_destroy()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<hr>
<p align="center">
<a href="http://www.globus.org/toolkit/about.html" target="_top">about globus</a> |
<a href="http://www.globus.org/toolkit/" target="_top">globus toolkit</a> |
<a href="https://dev.globus.org/wiki/Welcome/" target="_top">dev.globus</a>
<br>
<br>
Comments? <a href="mailto:webmaster@globus.org">webmaster@globus.org</a>
</body>
</html>