EXP: Replace thread_local with THREAD_LOCAL_VARIABLE
To fix Win crash
diff --git a/kotlin-native/runtime/src/main/cpp/AllocTest.cpp b/kotlin-native/runtime/src/main/cpp/AllocTest.cpp
index 94ea54e..4b61017 100644
--- a/kotlin-native/runtime/src/main/cpp/AllocTest.cpp
+++ b/kotlin-native/runtime/src/main/cpp/AllocTest.cpp
@@ -18,7 +18,7 @@
public:
using DestructorHook = testing::StrictMock<testing::MockFunction<void(int)>>;
- static thread_local DestructorHook* destructorHook;
+ static THREAD_LOCAL_VARIABLE DestructorHook* destructorHook;
explicit A(int value = -1) : value_(value) {}
@@ -33,7 +33,7 @@
};
// static
-thread_local A::DestructorHook* A::destructorHook = nullptr;
+THREAD_LOCAL_VARIABLE A::DestructorHook* A::destructorHook = nullptr;
struct B {
explicit B(int value) : a(value) {}
diff --git a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp
index 17e361c..a344bb8 100644
--- a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp
+++ b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp
@@ -40,4 +40,4 @@
mm::ThreadRegistry::~ThreadRegistry() = default;
// static
-thread_local mm::ThreadRegistry::Node* mm::ThreadRegistry::currentThreadDataNode_ = nullptr;
+THREAD_LOCAL_VARIABLE mm::ThreadRegistry::Node* mm::ThreadRegistry::currentThreadDataNode_ = nullptr;
diff --git a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp
index 9246203..f91dd35 100644
--- a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp
+++ b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp
@@ -48,7 +48,7 @@
ThreadRegistry();
~ThreadRegistry();
- static thread_local Node* currentThreadDataNode_;
+ static THREAD_LOCAL_VARIABLE Node* currentThreadDataNode_;
SingleLockList<ThreadData> list_;
};