10#ifndef _LOG4CPP_THREADING_OMNITHREADS_HH
11#define _LOG4CPP_THREADING_OMNITHREADS_HH
14#include <omnithread.h>
31 typedef omni_mutex
Mutex;
61 inline T*
get()
const {
62 Holder* holder =
dynamic_cast<Holder*
>(::omni_thread::self()->get_value(_key));
63 return (holder) ? holder->data : NULL;
93 Holder* holder =
dynamic_cast<Holder*
>(::omni_thread::self()->get_value(_key));
96 result = holder->data;
110 Holder* holder =
dynamic_cast<Holder*
>(::omni_thread::self()->get_value(_key));
117 holder =
new Holder(p);
118 ::omni_thread::self()->set_value(_key, holder);
123 class Holder :
public omni_thread::value_t {
133 Holder(
const Holder& other);
134 Holder& operator=(
const Holder& other);
137 omni_thread::key_t _key;
Definition PThreads.hh:28
definition of ScopedLock;
Definition PThreads.hh:57
This class holds Thread local data of type T, i.e.
Definition BoostThreads.hh:32
~ThreadLocalDataHolder()
Definition OmniThreads.hh:54
T data_type
Definition DummyThreads.hh:34
ThreadLocalDataHolder()
Definition OmniThreads.hh:52
T * operator->() const
Obtains the Object held for the current thread.
Definition OmniThreads.hh:72
T & operator*() const
Obtains the Object held for the current thread.
Definition OmniThreads.hh:81
T * get() const
Obtains the Object held for the current thread.
Definition OmniThreads.hh:61
void reset(T *p=NULL)
Sets a new Object to be held for the current thread.
Definition OmniThreads.hh:109
T * release()
Releases the Object held for the current thread.
Definition OmniThreads.hh:91
Definition BoostThreads.hh:21
static std::string getThreadId()
Return an identifier for the current thread.
Definition BoostThreads.hh:22
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16