Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
platform
MemoryTracking
ThreadLocalPointer.h
1
#pragma once
2
3
#include <pthread.h>
4
5
template
<
class
T>
6
class
ThreadLocalPointer
7
{
8
public
:
9
10
ThreadLocalPointer
()
11
{
12
pthread_key_create(&m_key, NULL);
13
}
14
15
~
ThreadLocalPointer
()
16
{
17
pthread_key_delete(m_key);
18
}
19
20
void
SetValue(T* _value)
21
{
22
pthread_setspecific(m_key, reinterpret_cast<const void*>(_value));
23
}
24
25
T* GetValue()
26
{
27
return
reinterpret_cast<
T*
>
(pthread_getspecific(m_key));
28
}
29
30
private
:
31
32
pthread_key_t m_key;
33
};
Generated on Sat Jun 10 2023 02:00:31 for eeGeo Platform SDK by
1.8.3.1