use __declspec(thread) on msvc