#include <memory_tds.h>
This class provides a thread specific (void*). It is initialized at NULL.
Nevrax France
Definition at line 44 of file memory_tds.h.
Public Member Functions | |
| CMemoryTDS () | |
| Constructor. The pointer is initialized with NULL. | |
| void * | getPointer () const |
| Get the thread specific pointer. | |
| void | setPointer (void *pointer) |
| Set the thread specific pointer. | |
| ~CMemoryTDS () | |
| Destructor. | |
Private Attributes | |
| pthread_key_t | _Key |
|
|
Constructor. The pointer is initialized with NULL.
Definition at line 43 of file memory_tds.cpp. References _Key.
00044 {
00045 /* Please no assert in the constructor because it is called by the NeL memory allocator constructor */
00046 #ifdef NL_OS_WINDOWS
00047 _Handle = TlsAlloc ();
00048 TlsSetValue (_Handle, NULL);
00049 #else // NL_OS_WINDOWS
00050 _Key = pthread_key_create (&_Key, 0);
00051 pthread_setspecific(_Key, 0);
00052 #endif // NL_OS_WINDOWS
00053 }
|
|
|
Destructor.
Definition at line 57 of file memory_tds.cpp. References _Key.
00058 {
00059 #ifdef NL_OS_WINDOWS
00060 TlsFree (_Handle);
00061 #else // NL_OS_WINDOWS
00062 pthread_key_delete (_Key);
00063 #endif // NL_OS_WINDOWS
00064 }
|
|
|
Get the thread specific pointer.
Definition at line 68 of file memory_tds.cpp. References _Key.
00069 {
00070 #ifdef NL_OS_WINDOWS
00071 return TlsGetValue (_Handle);
00072 #else // NL_OS_WINDOWS
00073 return pthread_getspecific (_Key);
00074 #endif // NL_OS_WINDOWS
00075 }
|
|
|
Set the thread specific pointer.
Definition at line 79 of file memory_tds.cpp.
00080 {
00081 #ifdef NL_OS_WINDOWS
00082 TlsSetValue (_Handle, pointer);
00083 #else // NL_OS_WINDOWS
00084 pthread_setspecific (_Key, pointer);
00085 #endif // NL_OS_WINDOWS
00086 }
|
|
|
Definition at line 64 of file memory_tds.h. Referenced by CMemoryTDS(), getPointer(), setPointer(), and ~CMemoryTDS(). |
1.3.6