Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_TSS_Info Class Reference

Thread Specific Key management. More...

#include <OS.h>

List of all members.

Public Methods

 ACE_TSS_Info (ACE_thread_key_t key, void(*dest)(void *)=0, void *tss_inst=0)
 Constructor. More...

 ACE_TSS_Info (void)
 Default constructor. More...

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

void key_in_use (int flag)
 Mark the key as being in use if the flag is non-zero, or not in use if the flag is 0. More...

int operator== (const ACE_TSS_Info &) const
 Check for equality. More...

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

void dump (void)
 Dump the state. More...


Private Attributes

ACE_thread_key_t key_
 Key to the thread-specific storage item. More...

void(* destructor_ )(void *)
 "Destructor" that gets called when the item is finally released. More...

void * tss_obj_
 Pointer to ACE_TSS<xxx> instance that has/will allocate the key. More...

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


Friends

class ACE_TSS_Cleanup


Detailed Description

Thread Specific Key management.

This class maps a key to a "destructor."

Definition at line 6550 of file OS.h.


Constructor & Destructor Documentation

ACE_TSS_Info::ACE_TSS_Info ACE_thread_key_t    key,
void(*    dest)(void *) = 0,
void *    tss_inst = 0
 

Constructor.

Definition at line 1647 of file OS.cpp.

References ACE_OS_TRACE, and ACE_thread_key_t.

01650   : key_ (key),
01651     destructor_ (dest),
01652     tss_obj_ (tss_inst),
01653     thread_count_ (-1)
01654 {
01655   ACE_OS_TRACE ("ACE_TSS_Info::ACE_TSS_Info");
01656 }

ACE_TSS_Info::ACE_TSS_Info void   
 

Default constructor.

Definition at line 1658 of file OS.cpp.

References ACE_OS_TRACE.

01659   : key_ (ACE_OS::NULL_key),
01660     destructor_ (0),
01661     tss_obj_ (0),
01662     thread_count_ (-1)
01663 {
01664   ACE_OS_TRACE ("ACE_TSS_Info::ACE_TSS_Info");
01665 }


Member Function Documentation

void ACE_TSS_Info::dump void   
 

Dump the state.

Definition at line 1700 of file OS.cpp.

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

Referenced by ACE_TSS_Cleanup::dump.

01701 {
01702   //  ACE_OS_TRACE ("ACE_TSS_Info::dump");
01703 
01704 #if 0
01705   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
01706   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("key_ = %u\n"), this->key_));
01707   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("destructor_ = %u\n"), this->destructor_));
01708   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("tss_obj_ = %u\n"), this->tss_obj_));
01709   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
01710 #endif /* 0 */
01711 }

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 6566 of file OS.h.

References thread_count_.

06566 { 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 6562 of file OS.h.

References thread_count_.

Referenced by ACE_TSS_Cleanup::exit, ACE_TSS_Cleanup::key_used, and ACE_TSS_Cleanup::remove.

06562 { return thread_count_ != -1; }

int ACE_TSS_Info::operator!= const ACE_TSS_Info &    const
 

Check for inequality.

Definition at line 1692 of file OS.cpp.

References ACE_OS_TRACE.

01693 {
01694   ACE_OS_TRACE ("ACE_TSS_Info::operator !=");
01695 
01696   return !(*this == info);
01697 }

int ACE_TSS_Info::operator== const ACE_TSS_Info &    const
 

Check for equality.

Definition at line 1683 of file OS.cpp.

References ACE_OS_TRACE, and key_.

01684 {
01685   ACE_OS_TRACE ("ACE_TSS_Info::operator==");
01686 
01687   return this->key_ == info.key_;
01688 }


Friends And Related Function Documentation

friend class ACE_TSS_Cleanup [friend]
 

Definition at line 6591 of file OS.h.


Member Data Documentation

void(* ACE_TSS_Info::destructor_)(void *) [private]
 

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

Referenced by ACE_TSS_Cleanup::exit, and ACE_TSS_Cleanup::remove.

ACE_thread_key_t ACE_TSS_Info::key_ [private]
 

Key to the thread-specific storage item.

Definition at line 6579 of file OS.h.

Referenced by ACE_TSS_Cleanup::exit, ACE_TSS_Cleanup::free_all_keys_left, operator==, and ACE_TSS_Cleanup::remove.

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 6589 of file OS.h.

Referenced by ACE_TSS_Cleanup::exit, key_in_use, and ACE_TSS_Cleanup::key_used.

void* ACE_TSS_Info::tss_obj_ [private]
 

Pointer to ACE_TSS<xxx> instance that has/will allocate the key.

Definition at line 6585 of file OS.h.

Referenced by ACE_TSS_Cleanup::detach, and ACE_TSS_Cleanup::exit.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:58:43 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002