ACE_TSS_Info Class Reference

Thread Specific Key management. More...

#include <OS_NS_Thread.h>

List of all members.

Public Types

typedef void(* Destructor )(void *)
 Declare pointer to function to destroy tss object.


Public Member Functions

 ACE_TSS_Info (ACE_thread_key_t key, Destructor dest=0)
 Constructor.

 ACE_TSS_Info (void)
 Default constructor.

int key_in_use (void) const
 Returns 1 if the key is in use, 0 if not.

void key_in_use (int flag)
bool operator== (const ACE_TSS_Info &) const
 Check for equality.

bool operator!= (const ACE_TSS_Info &) const
 Check for inequality.

void dump (void)
 Dump the state.


Private Attributes

ACE_thread_key_t key_
 Key to the thread-specific storage item.

Destructor destructor_
 "Destructor" that gets called when the item is finally released.

int thread_count_

Friends

class ACE_TSS_Cleanup


Detailed Description

Thread Specific Key management.

This class maps a key to a "destructor."

Definition at line 924 of file OS_NS_Thread.h.


Member Typedef Documentation

typedef void(* ACE_TSS_Info::Destructor)(void *)
 

Declare pointer to function to destroy tss object.

Definition at line 928 of file OS_NS_Thread.h.

Referenced by ACE_TSS_Cleanup::thread_detach_key(), ACE_TSS_Cleanup::thread_exit(), and ACE_TSS_Cleanup::thread_release().


Constructor & Destructor Documentation

ACE_TSS_Info::ACE_TSS_Info ACE_thread_key_t  key,
Destructor  dest = 0
 

Constructor.

ACE_TSS_Info::ACE_TSS_Info void   ) 
 

Default constructor.

Definition at line 461 of file OS_NS_Thread.cpp.

References ACE_OS_TRACE, destructor_(), and thread_count_().

00462   : key_ (ACE_OS::NULL_key),
00463     destructor_ (0),
00464     thread_count_ (-1)
00465 {
00466   ACE_OS_TRACE ("ACE_TSS_Info::ACE_TSS_Info");
00467 }


Member Function Documentation

void ACE_TSS_Info::dump void   ) 
 

Dump the state.

Definition at line 502 of file OS_NS_Thread.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, and LM_DEBUG.

Referenced by ACE_TSS_Cleanup::dump().

00503 {
00504 # if defined (ACE_HAS_DUMP)
00505   //  ACE_OS_TRACE ("ACE_TSS_Info::dump");
00506 
00507 #   if 0
00508   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00509   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("key_ = %u\n"), this->key_));
00510   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("destructor_ = %u\n"), this->destructor_));
00511   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00512 #   endif /* 0 */
00513 # endif /* ACE_HAS_DUMP */
00514 }

void ACE_TSS_Info::key_in_use int  flag  )  [inline]
 

Mark the key as being in use if the flag is non-zero, or not in use if the flag is 0.

Definition at line 942 of file OS_NS_Thread.h.

References thread_count_.

00942 { thread_count_ = flag == 0  ?  -1  :  1; }

int ACE_TSS_Info::key_in_use void   )  const [inline]
 

Returns 1 if the key is in use, 0 if not.

Definition at line 938 of file OS_NS_Thread.h.

References thread_count_.

Referenced by ACE_TSS_Cleanup::remove_key(), ACE_TSS_Cleanup::thread_detach_key(), ACE_TSS_Cleanup::thread_exit(), and ACE_TSS_Cleanup::thread_use_key().

00938 { return thread_count_ != -1; }

bool ACE_TSS_Info::operator!= const ACE_TSS_Info  )  const
 

Check for inequality.

Definition at line 494 of file OS_NS_Thread.cpp.

References ACE_OS_TRACE.

00495 {
00496   ACE_OS_TRACE ("ACE_TSS_Info::operator !=");
00497 
00498   return !(*this == info);
00499 }

bool ACE_TSS_Info::operator== const ACE_TSS_Info  )  const
 

Check for equality.

Definition at line 485 of file OS_NS_Thread.cpp.

References ACE_OS_TRACE, and key_.

00486 {
00487   ACE_OS_TRACE ("ACE_TSS_Info::operator==");
00488 
00489   return this->key_ == info.key_;
00490 }


Friends And Related Function Documentation

friend class ACE_TSS_Cleanup [friend]
 

Definition at line 964 of file OS_NS_Thread.h.


Member Data Documentation

Destructor ACE_TSS_Info::destructor_ [private]
 

"Destructor" that gets called when the item is finally released.

Definition at line 958 of file OS_NS_Thread.h.

Referenced by ACE_TSS_Cleanup::remove_key(), and ACE_TSS_Cleanup::thread_release().

ACE_thread_key_t ACE_TSS_Info::key_ [private]
 

Key to the thread-specific storage item.

Definition at line 955 of file OS_NS_Thread.h.

Referenced by operator==(), ACE_TSS_Cleanup::remove_key(), ACE_TSS_Cleanup::thread_exit(), and ACE_TSS_Cleanup::thread_release().

int ACE_TSS_Info::thread_count_ [private]
 

Count of threads that are using this key. Contains -1 when the key is not in use.

Definition at line 962 of file OS_NS_Thread.h.

Referenced by ACE_TSS_Cleanup::insert(), key_in_use(), ACE_TSS_Cleanup::remove_key(), ACE_TSS_Cleanup::thread_release(), and ACE_TSS_Cleanup::thread_use_key().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:32:01 2006 for ACE by doxygen 1.3.6