std::thread for game's plugin

I was using the std::thread and std::mutex for the code that I’m using.

But apparently std::thread has an #include concrt.h statement inside of its header. So Unreal gives me the error(when I tried to package game):

MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\concrt.h(313) : error C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\concrt.h(4774) : error C3861: '__uncaught_exception': identifier not found

Use UE4 APIs instead of standard C++ Standard libery. This way threads will be visible by engine and they will show up in UE4 profiler. Here you got basic tutorial:

UE4 has a lot of standard API wrapped up and by using those wrappers you sure that you code will build and run on any platfrom that UE4 supports as well as they be managed by UE4. So search for functions in UE4 APIs first and if you don’t find anything try using other APIs

The error it self seems to be cause by compiler options, which are managed by UBT. But i don’t think there way to set up in UBT, maybe in UBT configs in saved