#include <AbstractThreadLocal.h>
Inheritance diagram for ZThread::AbstractThreadLocal::
Public Methods | |
AbstractThreadLocal () throw () | |
virtual | ~AbstractThreadLocal () throw () |
Protected Methods | |
virtual void* | initialValue (void *)=0 throw () |
virtual void* | childValue (void *parentValue) throw () |
virtual bool | propogateValue ()=0 throw () |
void* | fetch () const throw (Synchronization_Exception) |
void* | get () const throw (Synchronization_Exception) |
void* | set (void *) const throw (Synchronization_Exception) |
This class implements the minimum set of functionality needed to provide more specific, and strongly typed support than is otherwise available.
NOTE: Any AbstractThreadLocal MUST be a static variable. This allows for the fastest and most logical use of thread sepcific variables. In addition, it is not worth the extra overhead involved with keeping track of variables that may go out of scope of be deteled from one thread while others are using. While this would be possible, there is a speed tradeoff & a strange relationship between a thread and ThreadLocal variables that might disappear. It seems a little too awkawrd with very little, if any, benefit to use these variables in that way.
|
Create a newAbstractThreadLocal object |
|
Destroy this AbstractThreadLocal object |
|
Invoked by the framework whenever a per/thread, or thread-specfic initialization is required.
Reimplemented in ZThread::InheritableThreadLocal. |
|
Get a value with thisAbstractThreadLocal object. Any value retrieved from this object will have been set from the same Thread. No initilization is performed with this function.
|
|
Get a value with thisAbstractThreadLocal object. Any value retrieved from this object will have been set from the same Thread. Causes initialize() to be called if appropriate.
Reimplemented in ZThread::FastThreadLocal, and ZThread::ThreadLocal. |
|
Invoked by the framework whenever a per/thread, or thread-specfic initialization is required.
Reimplemented in ZThread::FastThreadLocal, and ZThread::ThreadLocal. |
|
Invoked by the framework whenever it needs to be determined wether or not this value should propogate to child threads.
Reimplemented in ZThread::FastThreadLocal, ZThread::InheritableThreadLocal, and ZThread::ThreadLocal. |
|
Set a value with this AbstractThreadLocal object. This value can only be retrieved from this AbstractThreadLocal object from the same Thread that set it.
|