20 #include <winpr/config.h>
22 #include <winpr/handle.h>
24 #include <winpr/thread.h>
39 pthread_key_t key = 0;
41 if (pthread_key_create(&key, NULL) != 0)
42 return TLS_OUT_OF_INDEXES;
47 LPVOID TlsGetValue(DWORD dwTlsIndex)
50 pthread_key_t key = 0;
51 key = (pthread_key_t)dwTlsIndex;
52 value = (LPVOID)pthread_getspecific(key);
56 BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue)
58 pthread_key_t key = 0;
59 key = (pthread_key_t)dwTlsIndex;
60 pthread_setspecific(key, lpTlsValue);
64 BOOL TlsFree(DWORD dwTlsIndex)
66 pthread_key_t key = 0;
67 key = (pthread_key_t)dwTlsIndex;
68 pthread_key_delete(key);