activemq-cpp-3.6.0
decaf::internal::util::concurrent::ThreadLocalImpl Class Reference

#include <src/main/decaf/internal/util/concurrent/ThreadLocalImpl.h>

Inheritance diagram for decaf::internal::util::concurrent::ThreadLocalImpl:

Public Member Functions

 ThreadLocalImpl ()
virtual ~ThreadLocalImpl ()
void * getRawValue () const
 Returns the current threads assigned value, but retains ownership to this value unless the remove method is subsequently called.
void setRawValue (void *value)
 Sets the raw void* value for the current thread.
void removeAll ()
 Removes from all threads any allocated data stored for this ThreadLocal instance.
virtual void doDelete (void *value)=0
 Called to destroy the value held by the current thread or by the library on shutdown if there are still ThreadLocalImpl instances that have assigned TLS slots.

Constructor & Destructor Documentation

decaf::internal::util::concurrent::ThreadLocalImpl::ThreadLocalImpl ( )
virtual decaf::internal::util::concurrent::ThreadLocalImpl::~ThreadLocalImpl ( )
virtual

Member Function Documentation

virtual void decaf::internal::util::concurrent::ThreadLocalImpl::doDelete ( void *  value)
pure virtual

Called to destroy the value held by the current thread or by the library on shutdown if there are still ThreadLocalImpl instances that have assigned TLS slots.

Its up to the implementor if this interface to ensure that the value held in the void* is cleaned up correctly.

Parameters
valueThe value to be destroyed for the current thread.

Implemented in decaf::lang::ThreadLocal< E >.

void* decaf::internal::util::concurrent::ThreadLocalImpl::getRawValue ( ) const

Returns the current threads assigned value, but retains ownership to this value unless the remove method is subsequently called.

Returns
the currently held value for this thread.

Referenced by decaf::lang::ThreadLocal< E >::get().

void decaf::internal::util::concurrent::ThreadLocalImpl::removeAll ( )

Removes from all threads any allocated data stored for this ThreadLocal instance.

Subclasses should call this method in their destructor to ensure that all the values that are stored in each thread can be deallocated using their custom doDelete method.

Referenced by decaf::lang::ThreadLocal< E >::~ThreadLocal().

void decaf::internal::util::concurrent::ThreadLocalImpl::setRawValue ( void *  value)

Sets the raw void* value for the current thread.

If the value is NULL and the old value is non-NULL then the library will call the doDelete method to destroy the previous value.

Parameters
valuePointer to the value to be stored for the current thread or NULL.

Referenced by decaf::lang::ThreadLocal< E >::get(), decaf::lang::ThreadLocal< E >::remove(), and decaf::lang::ThreadLocal< E >::set().


The documentation for this class was generated from the following file: