Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 5eb826aa4501ed8d8df68ed910a162ee > files > 89

globus-common-doc-14.6-1.fc15.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.7.4 -->
  <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>
<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('group__globus__thread__key.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Thread-Specific Storage</div>  </div>
<div class="ingroups"><a class="el" href="group__globus__thread.html">Threading</a></div></div>
<div class="contents">
<div class="dynheader">
Collaboration diagram for Thread-Specific Storage:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group__globus__thread__key.png" border="0" alt="" usemap="#group____globus____thread____key"/>
<map name="group____globus____thread____key" id="group____globus____thread____key">
<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="7,5,84,35"/></map>
</td></tr></table></center>
</div>
<h2><a name="func-members"></a>
Functions</h2>
<ul>
<li>int <a class="el" href="group__globus__thread__key.html#gac1e87a67ba01b481cab00e58c04066f9">globus_thread_key_create</a> (<a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a> *key, <a class="el" href="group__globus__thread.html#gab9a4db7600579bd5aad4383fa57551d9">globus_thread_key_destructor_func_t</a> destructor)
<li>int <a class="el" href="group__globus__thread__key.html#ga3a0ea6cd8557e23d25ca4bb4abac205a">globus_thread_key_delete</a> (<a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a> key)
<li>void * <a class="el" href="group__globus__thread__key.html#ga54b93ce20069e0616e5b05e2be49d240">globus_thread_getspecific</a> (<a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a> key)
<li>int <a class="el" href="group__globus__thread__key.html#ga576439a7030a7e1dc81da6c36d05655f">globus_thread_setspecific</a> (<a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a> key, void *value)
</ul>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>The <a class="el" href="unionglobus__thread__key__t.html" title="Thread-specific data key.">globus_thread_key_t</a> data type acts as a key to thread-specific storage. For each key created by <a class="el" href="group__globus__thread__key.html#gac1e87a67ba01b481cab00e58c04066f9" title="Create a key for thread-specific storage.">globus_thread_key_create()</a>, each thread may store and retrieve its own value. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gac1e87a67ba01b481cab00e58c04066f9"></a><!-- doxytag: member="globus_thread.c::globus_thread_key_create" ref="gac1e87a67ba01b481cab00e58c04066f9" args="(globus_thread_key_t *key, globus_thread_key_destructor_func_t destructor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_thread_key_create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a> *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__globus__thread.html#gab9a4db7600579bd5aad4383fa57551d9">globus_thread_key_destructor_func_t</a>&#160;</td>
          <td class="paramname"><em>destructor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create a key for thread-specific storage. </p>
<p>The <a class="el" href="group__globus__thread__key.html#gac1e87a67ba01b481cab00e58c04066f9" title="Create a key for thread-specific storage.">globus_thread_key_create()</a> function creates a new key for thread-specific data. The new key will be available for all threads to store a distinct value. If the function pointer <em>destructor</em> is non-NULL, then that function will be invoked when a thread exits that has a non-NULL value associated with the key.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Pointer to be set to the new key. </td></tr>
    <tr><td class="paramname">destructor</td><td>Pointer to a function to call when a thread exits to free the key's value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, globus_thread_create_key() will create a new key to thread-local storage and return GLOBUS_SUCCESS. If an error occurs, then the value of <em>key</em> is undefined and globus_thread_create_key() returns an implementation-specific non-zero error value. </dd></dl>

</div>
</div>
<a class="anchor" id="ga3a0ea6cd8557e23d25ca4bb4abac205a"></a><!-- doxytag: member="globus_thread.c::globus_thread_key_delete" ref="ga3a0ea6cd8557e23d25ca4bb4abac205a" args="(globus_thread_key_t key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_thread_key_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a>&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Delete a thread-local storage key. </p>
<p>The <a class="el" href="group__globus__thread__key.html#ga3a0ea6cd8557e23d25ca4bb4abac205a" title="Delete a thread-local storage key.">globus_thread_key_delete()</a> function deletes the key used for a thread-local storage association. The destructor function for this key will no longer be called after this function returns. The behavior of subsequent calls to <a class="el" href="group__globus__thread__key.html#ga54b93ce20069e0616e5b05e2be49d240" title="Get a thread-specific data value.">globus_thread_getspecific()</a> or <a class="el" href="group__globus__thread__key.html#ga576439a7030a7e1dc81da6c36d05655f" title="Set a thread-specific data value.">globus_thread_setspecific()</a> with this key will be undefined.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key to destroy.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, <a class="el" href="group__globus__thread__key.html#ga3a0ea6cd8557e23d25ca4bb4abac205a" title="Delete a thread-local storage key.">globus_thread_key_delete()</a> will delete a thread-local storage key and return GLOBUS_SUCCESS. If an error occurs, then the value of <em>key</em> is undefined and globus_thread_create_key() returns an implementation-specific non-zero error value. </dd></dl>

</div>
</div>
<a class="anchor" id="ga54b93ce20069e0616e5b05e2be49d240"></a><!-- doxytag: member="globus_thread.c::globus_thread_getspecific" ref="ga54b93ce20069e0616e5b05e2be49d240" args="(globus_thread_key_t key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* globus_thread_getspecific </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a>&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get a thread-specific data value. </p>
<p>The <a class="el" href="group__globus__thread__key.html#ga54b93ce20069e0616e5b05e2be49d240" title="Get a thread-specific data value.">globus_thread_getspecific()</a> function returns the value associated with the thread-specific data key passed as its first parameter. This function returns NULL if the value has not been set by the current thread. The return value is undefined if the key is not valid. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Thread-specific data key to look up. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The value passed to a previous call to <a class="el" href="group__globus__thread__key.html#ga576439a7030a7e1dc81da6c36d05655f" title="Set a thread-specific data value.">globus_thread_setspecific()</a> in the current thread for this key. </dd></dl>

</div>
</div>
<a class="anchor" id="ga576439a7030a7e1dc81da6c36d05655f"></a><!-- doxytag: member="globus_thread.c::globus_thread_setspecific" ref="ga576439a7030a7e1dc81da6c36d05655f" args="(globus_thread_key_t key, void *value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int globus_thread_setspecific </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="unionglobus__thread__key__t.html">globus_thread_key_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set a thread-specific data value. </p>
<p>The <a class="el" href="group__globus__thread__key.html#ga576439a7030a7e1dc81da6c36d05655f" title="Set a thread-specific data value.">globus_thread_setspecific()</a> function associates a thread-specific value with a data key. If the key had a previous value set in the current thread, it is replaced, but the destructor function is not called for the old value. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Thread-specific data key to store. </td></tr>
    <tr><td class="paramname">value</td><td>A pointer to data to store as the thread-specific data for this thread. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On success, <a class="el" href="group__globus__thread__key.html#ga576439a7030a7e1dc81da6c36d05655f" title="Set a thread-specific data value.">globus_thread_setspecific()</a> stores value in the thread-specific data for the specified key and returns GLOBUS_SUCCESS. If an error occurs, <a class="el" href="group__globus__thread__key.html#ga576439a7030a7e1dc81da6c36d05655f" title="Set a thread-specific data value.">globus_thread_setspecific()</a> returns an implementation-specific non-zero error code and does not modify the key's value for this thread. </dd></dl>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<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>