Fix a warning.
[mono-project/dkf.git] / mono / utils / mono-tls.h
blob2d2a0b2dee3154f91f97d555c75fcde6963af587
1 /*
2 * mono-tls.h: Low-level TLS support
4 * Author:
5 * Rodrigo Kumpera (kumpera@gmail.com)
7 * (C) 2011 Novell, Inc
8 */
10 #ifndef __MONO_TLS_H__
11 #define __MONO_TLS_H__
14 #ifdef HOST_WIN32
16 #include <windows.h>
18 #define MonoNativeTlsKey DWORD
19 #define mono_native_tls_alloc(key,destructor) ((key = TlsAlloc ()) != TLS_OUT_OF_INDEXES && destructor == NULL)
20 #define mono_native_tls_set_value TlsSetValue
21 #define mono_native_tls_get_value TlsGetValue
23 #else
25 #include <pthread.h>
27 #define MonoNativeTlsKey pthread_key_t
28 #define mono_native_tls_alloc(key,destructor) (pthread_key_create (&key, destructor) == 0)
29 #define mono_native_tls_set_value pthread_setspecific
30 #define mono_native_tls_get_value pthread_getspecific
32 #endif /* HOST_WIN32 */
35 #endif /* __MONO_TLS_H__ */