avoid slow TLS with MinGW

Recent versions of MinGW-W64 use emutls for `__thread` variables,
and that's much slower than Windows-native TLS. Go back to the
inline-assembly implementation of therad-local access.
This commit is contained in:
Matthew Flatt 2015-10-20 15:39:28 -06:00
parent 5d74897aa4
commit b8ba78d1d3

View File

@ -30,12 +30,13 @@ extern "C" {
# ifdef _WIN32
# if defined(_WIN64)
# if defined(__MINGW32__)
# define THREAD_LOCAL __thread
# define THREAD_LOCAL /* empty */
# define IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS
# else
# define THREAD_LOCAL __declspec(thread)
# define MZ_THREAD_EXTERN extern
# define IMPLEMENT_THREAD_LOCAL_EXTERNALLY_VIA_PROC
# endif
# define MZ_THREAD_EXTERN extern
# define IMPLEMENT_THREAD_LOCAL_EXTERNALLY_VIA_PROC
# else
# define THREAD_LOCAL /* empty */
# define IMPLEMENT_THREAD_LOCAL_VIA_WIN_TLS