#include <Synch_T.h>
Public Methods | |
ACE_TSS (TYPE *ts_obj = 0) | |
virtual | ~ACE_TSS (void) |
Deregister with thread-key administration. | |
TYPE* | ts_object (void) const |
TYPE* | ts_object (TYPE *) |
Set the thread-specific object for the key associated with this object. | |
TYPE* | operator-> () const |
Use a "smart pointer" to get the thread-specific object associated with the <key_>. | |
operator TYPE * (void) const | |
Return or create and return the calling threads TYPE object. | |
virtual TYPE* | make_TSS_TYPE (void) const |
Hook for construction parameters. | |
void | dump (void) const |
Dump the state of an object. | |
Protected Methods | |
TYPE* | ts_get (void) const |
Actually implements the code that retrieves the object from thread-specific storage. | |
int | ts_init (void) const |
Factors out common code for initializing TSS. This must NOT be called with the lock held... | |
void | operator= (const ACE_TSS<TYPE> &) |
ACE_TSS (const ACE_TSS<TYPE> &) | |
Protected Attributes | |
TYPE* | type_ |
This implementation only works for non-threading systems... |
This class is a wrapper around the OS thread library thread-specific functions. It uses the <C++ operator->> to shield applications from the details of accessing thread-specific storage.
NOTE: For maximal portability, <TYPE> cannot be a built-in type, but instead should be a user-defined class (some compilers will allow a built-in type, others won't). See template class ACE_TSS_Type_Adapter, below, for adapting built-in types to work with ACE_TSS.
|
If caller has passed us a non-NULL ts_obj *, then we'll just use this to initialize the thread-specific value (but only for the calling thread). Thus, subsequent calls to <operator->> in this thread will return this value. This is useful since it enables us to assign objects to thread-specific data that have arbitrarily complex constructors. |
|
Deregister with thread-key administration.
|
|
|
|
Dump the state of an object.
|
|
Hook for construction parameters.
|
|
Return or create and return the calling threads TYPE object.
|
|
Use a "smart pointer" to get the thread-specific object associated with the <key_>.
|
|
|
|
Actually implements the code that retrieves the object from thread-specific storage.
|
|
Factors out common code for initializing TSS. This must NOT be called with the lock held...
|
|
Set the thread-specific object for the key associated with this object.
|
|
Get the thread-specific object for the key associated with this object. Returns 0 if the data has never been initialized, otherwise returns a pointer to the data. |
|
This implementation only works for non-threading systems...
|