mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
Add workaround for msvc 2015 update 1 with 1 CPU.
This commit is contained in:
parent
7923c3e0c7
commit
c438a388d7
@ -49,7 +49,13 @@ namespace chaiscript
|
||||
|
||||
#ifndef CHAISCRIPT_NO_THREADS
|
||||
lib->add(standard_library::future_type<std::future<chaiscript::Boxed_Value>>("future"));
|
||||
#ifdef CHAISCRIPT_MSVC
|
||||
/// this is to work around an issue that seems to only come up on single CPU hosts on MSVC 2015 Update 1
|
||||
/// \todo reevaluate this later
|
||||
lib->add(chaiscript::fun([](const std::function<chaiscript::Boxed_Value ()> &t_func){ return std::async(std::thread::hardware_concurrency() <= 1 ? std::launch::deferred : std::launch::async, t_func);}), "async");
|
||||
#else
|
||||
lib->add(chaiscript::fun([](const std::function<chaiscript::Boxed_Value ()> &t_func){ return std::async(std::launch::async, t_func);}), "async");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
lib->add(json_wrap::library());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user