#include <tds.h>
This class provides a thread specific (void*). It is initialized at NULL.
Nevrax France
Definition at line 46 of file tds.h.
Public Member Functions | |
CTDS () | |
Constructor. The pointer is initialized with NULL. | |
void * | getPointer () const |
Get the thread specific pointer. | |
void | setPointer (void *pointer) |
Set the thread specific pointer. | |
~CTDS () | |
Destructor. | |
Private Attributes | |
pthread_key_t | _Key |
|
Constructor. The pointer is initialized with NULL.
Definition at line 41 of file tds.cpp.
00042 { 00043 /* Please no assert in the constructor because it is called by the NeL memory allocator constructor */ 00044 #ifdef NL_OS_WINDOWS 00045 _Handle = TlsAlloc (); 00046 TlsSetValue (_Handle, NULL); 00047 #else // NL_OS_WINDOWS 00048 _Key = pthread_key_create (&_Key, NULL); 00049 pthread_setspecific(_Key, NULL); 00050 #endif // NL_OS_WINDOWS 00051 } |
|
Destructor.
Definition at line 55 of file tds.cpp. References nlverify.
|
|
Get the thread specific pointer.
Definition at line 66 of file tds.cpp. Referenced by NLMISC::CHeapAllocator::debugPopCategoryString(), NLMISC::CHeapAllocator::debugPushCategoryString(), and NLMISC::CBigFile::CThreadFileArray::get().
00067 { 00068 #ifdef NL_OS_WINDOWS 00069 return TlsGetValue (_Handle); 00070 #else // NL_OS_WINDOWS 00071 return pthread_getspecific (_Key); 00072 #endif // NL_OS_WINDOWS 00073 } |
|
Set the thread specific pointer.
Definition at line 77 of file tds.cpp. References nlverify, and pointer. Referenced by NLMISC::CHeapAllocator::debugPopCategoryString(), NLMISC::CHeapAllocator::debugPushCategoryString(), and NLMISC::CBigFile::CThreadFileArray::get().
|
|
|