MCPcopy Create free account
hub / github.com/Ableton/link / makeThread

Method makeThread

include/ableton/platforms/windows/ThreadFactory.hpp:70–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68{
69 template <typename Callable, typename... Args>
70 static std::thread makeThread(std::string name, Callable&& f, Args&&... args)
71 {
72 return std::thread(
73 [](std::string name, Callable&& f, Args&&... args)
74 {
75 assert(name.length() < 20);
76 wchar_t nativeName[20];
77 mbstowcs(nativeName, name.c_str(), name.length() + 1);
78 SetThreadDescription(GetCurrentThread(), nativeName);
79 f(args...);
80 },
81 std::move(name),
82 std::forward<Callable>(f),
83 std::forward<Args>(args)...);
84 }
85};
86
87} // namespace windows

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected