diff --git a/include/chaiscript/chaiscript_stdlib.hpp b/include/chaiscript/chaiscript_stdlib.hpp index 4b38f2c..84797b7 100644 --- a/include/chaiscript/chaiscript_stdlib.hpp +++ b/include/chaiscript/chaiscript_stdlib.hpp @@ -49,7 +49,13 @@ namespace chaiscript #ifndef CHAISCRIPT_NO_THREADS lib->add(standard_library::future_type>("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 &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 &t_func){ return std::async(std::launch::async, t_func);}), "async"); +#endif #endif lib->add(json_wrap::library());