1 #ifndef INCLUDE_git_thread_utils_h__
2 #define INCLUDE_git_thread_utils_h__
4 * How TLS works is compiler+platform dependant
5 * Sources: http://en.wikipedia.org/wiki/Thread-Specific_Storage
6 * http://predef.sourceforge.net/precomp.html
9 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || \
10 defined(__xlc__) || defined(__xlC__)
11 # define GIT_TLS __thread
12 #elif defined(__INTEL_COMPILER)
13 # if defined(_WIN32) || defined(_WIN32_CE)
14 # define GIT_TLS __declspec(thread)
16 # define GIT_TLS __thread
18 #elif defined(_WIN32) || defined(_WIN32_CE) || defined(__BORLANDC__)
19 # define GIT_TLS __declspec(thread)
22 # define GIT_TLS /* nothing: tls vars are thread-global */
25 /* sparse doesn't grok thread-local variables */
26 #if defined(__CHECKER__)
32 #endif /* INCLUDE_git_thread_utils_h__ */