The Nebula Device 3: OSX::OSXThreadLocalPtr< TYPE > Class Template Reference

The Nebula Device 3

OSX::OSXThreadLocalPtr< TYPE > Class Template Reference

#include <osxthreadlocalptr.h>


Detailed Description

template<typename TYPE>
class OSX::OSXThreadLocalPtr< TYPE >

GCC doesn't implement the __thread modifier on OSX. Instead we use pthread keys to emulate the behaviour.

Todo:
: Performance? Would it actually be better to allocate one pointer lookup-table and associate this with a single thread-local key as like on the Wii? At the moment every Ptr has its own key.
Todo:
: If this object will be used for anything else then singleton, it might make sense to change the interface to look like a normal C-pointer.
(C) 2010 Radon Labs GmbH


Public Member Functions

 OSXThreadLocalPtr ()
 default constructor
 ~OSXThreadLocalPtr ()
 destructor
void set (TYPE *p)
 set content
TYPE * get () const
 get content
bool isvalid () const
 test if content is valid