| 328 | } |
| 329 | |
| 330 | void ThreadImpl::setName(const char* name) |
| 331 | { |
| 332 | getThread(this)->name = name; |
| 333 | |
| 334 | if (getThread(this)->state == _PxThreadStarted) |
| 335 | { |
| 336 | #if(defined(ANDROID) && (__ANDROID_API__ > 8)) |
| 337 | pthread_setname_np(getThread(this)->thread, name); |
| 338 | #elif PX_PS4 |
| 339 | setNamePS4(getThread(this)->thread, name); |
| 340 | #else |
| 341 | // not implemented because most unix APIs expect setName() |
| 342 | // to be called from the thread's context. Example see next comment: |
| 343 | |
| 344 | // this works only with the current thread and can rename |
| 345 | // the main process if used in the wrong context: |
| 346 | // prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name) ,0,0,0); |
| 347 | PX_UNUSED(name); |
| 348 | #endif |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | #if !PX_APPLE_FAMILY |
| 353 | static ThreadPriority::Enum convertPriorityFromLinux(uint32_t inPrio, int policy) |