Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 68d373e54fb21da3730c08bede406633 > files > 396

libCommonC++1.9_3-devel-1.9.4-2mdk.i586.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=iso-8859-1">
<title>ThreadKey class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.5 on Thu Oct 4 15:33:02 2001 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>ThreadKey  Class Reference</h1>This class allows the creation of a thread context unique "pointer" that can be set and retrieved and can be used to create thread specific data areas for implementing "thread safe" library routines. container for thread specific data storage. 
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="thread_h-source.html">thread.h</a>&gt;</code>
<p>
<a href="class_threadkey-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_threadkey.html#a0">ThreadKey</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Create a unique thread specific container.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_threadkey.html#a1">~ThreadKey</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Destroy a thread specific container and any contents reserved.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void*&nbsp;</td><td valign=bottom><a class="el" href="class_threadkey.html#a2">getKey</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get the value of the pointer for the thread specific data container.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_threadkey.html#a3">setKey</a> (void *)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set the value of the pointer for the current thread specific execution context.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class allows the creation of a thread context unique "pointer" that can be set and retrieved and can be used to create thread specific data areas for implementing "thread safe" library routines. container for thread specific data storage.
<p>
Finally, Common C++ supports a thread-safe "<a class="el" href="class_atomiccounter.html">AtomicCounter</a>" class. This can often be used for reference counting without having to protect the counter with a separate <a class="el" href="class_mutex.html">Mutex</a> counter. This lends to lighter-weight code.
<p>
<dl compact><dt>
<b>Author(s): </b><dd>
 David Sugar &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; </dl>
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="ThreadKey::ThreadKey"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
ThreadKey::ThreadKey (
          </b></td>
          <td valign="bottom"><b>
)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a unique thread specific container.
<p>
    </td>
  </tr>
</table>
<a name="a1" doxytag="ThreadKey::~ThreadKey"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
ThreadKey::~ThreadKey (
          </b></td>
          <td valign="bottom"><b>
)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Destroy a thread specific container and any contents reserved.
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a2" doxytag="ThreadKey::getKey"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void * ThreadKey::getKey (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the value of the pointer for the thread specific data container.
<p>
A unique pointer can be set for each execution context.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
 a unique void * for each execution context. </dl>    </td>
  </tr>
</table>
<a name="a3" doxytag="ThreadKey::setKey"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void ThreadKey::setKey (
          </b></td>
          <td valign="bottom"><b>
void *&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set the value of the pointer for the current thread specific execution context.
<p>
This can be used to store thread context specific data.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>ptr</em>
&nbsp;</td><td>
 to thread context specific data. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="thread_h-source.html">thread.h</a></ul>
<hr><address><small>Generated at Thu Oct 4 15:33:02 2001 for CommonC++ by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.5 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>