MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / set_thread_name

Function set_thread_name

Source/astcenccli_platform_dependents.cpp:156–171  ·  view source on GitHub ↗

See header for documentation */

Source from the content-addressed store, hash-verified

154
155/* See header for documentation */
156void set_thread_name(
157 const char* name
158) {
159 // Names are limited to 16 characters
160 wchar_t wname [16] { 0 };
161 size_t name_len = std::strlen(name);
162 size_t clamp_len = std::min<size_t>(name_len, 15);
163
164 // We know we only have basic 7-bit ASCII so just widen
165 for (size_t i = 0; i < clamp_len; i++)
166 {
167 wname[i] = static_cast<wchar_t>(name[i]);
168 }
169
170 SetThreadDescription(GetCurrentThread(), wname);
171}
172
173/* ============================================================================
174 Platform code for a platform using POSIX APIs.

Callers 3

astcenc_mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected