activemq-cpp-3.9.0
|
#include <src/main/decaf/internal/util/concurrent/ThreadLocalImpl.h>
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. More... | |
void | setRawValue (void *value) |
Sets the raw void* value for the current thread. More... | |
void | removeAll () |
Removes from all threads any allocated data stored for this ThreadLocal instance. More... | |
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. More... | |
decaf::internal::util::concurrent::ThreadLocalImpl::ThreadLocalImpl | ( | ) |
|
virtual |
|
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.
value | The 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.
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.
value | Pointer 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().