14 #include <system_error>
27 std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
47 template<
class TFn,
class... TArgs>
48 inline bool StartNewThread(std::thread *thr,
const char *name, TFn&& _Fx, TArgs&&... _Ax)
52 std::thread t([] (
const char *name, TFn&& F, TArgs&&... A) {
61 }, name, std::forward<TFn>(_Fx), std::forward<TArgs>(_Ax)...);
70 }
catch (
const std::system_error& e) {
72 DEBUG(misc, 1,
"Can't create thread '%s': %s", name, e.what());