mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
Fix: added 'static' to thread_local variable in chaiscript/chaiscript_threading.hpp
Because it's a singleton and should be one instance per thread, without it will be singleton per call, also it won't compile on VS2017 15.8.9 The error: chaiscript\include\chaiscript\chaiscript_threading.hpp(107): error C2480: 'my_t': 'thread' is only valid for data items of static extent
This commit is contained in:
parent
8d0fc74341
commit
7a67963ca7
@ -107,7 +107,7 @@ namespace chaiscript
|
||||
/// does there is no possible way to recover
|
||||
static std::unordered_map<const void*, T> &t() noexcept
|
||||
{
|
||||
thread_local std::unordered_map<const void *, T> my_t;
|
||||
static thread_local std::unordered_map<const void *, T> my_t;
|
||||
return my_t;
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user