modify global js window map to thread local

Signed-off-by: chyyy0213 <chenhaiying3@huawei.com>
Change-Id: I8cd66959164d636985a5b23f227607279f72a1e3
This commit is contained in:
chyyy0213
2022-04-21 10:46:59 +08:00
parent e82c093af9
commit a96da0b555
@@ -26,7 +26,7 @@ namespace {
constexpr Rect g_emptyRect = {0, 0, 0, 0};
}
static std::map<std::string, std::shared_ptr<NativeReference>> g_jsWindowMap;
static thread_local std::map<std::string, std::shared_ptr<NativeReference>> g_jsWindowMap;
std::recursive_mutex g_mutex;
JsWindow::JsWindow(const sptr<Window>& window)
: windowToken_(window), registerManager_(std::make_unique<JsWindowRegisterManager>())