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 925 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 929 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 408 of file OS_NS_Thread.cpp.

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

00409   : key_ (ACE_OS::NULL_key),
00410     destructor_ (0),
00411     thread_count_ (-1)
00412 {
00413   ACE_OS_TRACE ("ACE_TSS_Info::ACE_TSS_Info");
00414 }


Member Function Documentation

void ACE_TSS_Info::dump void   ) 
 

Dump the state.

Definition at line 449 of file OS_NS_Thread.cpp.

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

Referenced by ACE_TSS_Cleanup::dump().

00450 {
00451 # if defined (ACE_HAS_DUMP)
00452   //  ACE_OS_TRACE ("ACE_TSS_Info::dump");
00453 
00454 #   if 0
00455   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00456   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("key_ = %u\n"), this->key_));
00457   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("destructor_ = %u\n"), this->destructor_));
00458   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00459 #   endif /* 0 */
00460 # endif /* ACE_HAS_DUMP */
00461 }

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 943 of file OS_NS_Thread.h.

References thread_count_.

00943 { 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 939 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().

00939 { return thread_count_ != -1; }

bool ACE_TSS_Info::operator!= const ACE_TSS_Info  )  const
 

Check for inequality.

Definition at line 441 of file OS_NS_Thread.cpp.

References ACE_OS_TRACE.

00442 {
00443   ACE_OS_TRACE ("ACE_TSS_Info::operator !=");
00444 
00445   return !(*this == info);
00446 }

bool ACE_TSS_Info::operator== const ACE_TSS_Info  )  const
 

Check for equality.

Definition at line 432 of file OS_NS_Thread.cpp.

References ACE_OS_TRACE, and key_.

00433 {
00434   ACE_OS_TRACE ("ACE_TSS_Info::operator==");
00435 
00436   return this->key_ == info.key_;
00437 }


Friends And Related Function Documentation

friend class ACE_TSS_Cleanup [friend]
 

Definition at line 965 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 959 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 956 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 963 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 Sun Jan 27 12:59:14 2008 for ACE by doxygen 1.3.6