* Changes the name of the caller thread. */
| 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 |