MCPcopy Create free account
hub / github.com/DISTRHO/DPF / setCurrentThreadName

Function setCurrentThreadName

distrho/extra/Thread.hpp:249–259  ·  view source on GitHub ↗

* Changes the name of the caller thread. */

Source from the content-addressed store, hash-verified

247 * Changes the name of the caller thread.
248 */
249 static void setCurrentThreadName(const char* const name) noexcept
250 {
251 DISTRHO_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0',);
252
253 #ifdef DISTRHO_OS_LINUX
254 prctl(PR_SET_NAME, name, 0, 0, 0);
255 #endif
256 #if defined(__GLIBC__) && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 && !defined(DISTRHO_OS_GNU_HURD)
257 pthread_setname_np(pthread_self(), name);
258 #endif
259 }
260
261 // -------------------------------------------------------------------
262

Callers 1

_runEntryPointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected