| 339 | } |
| 340 | |
| 341 | void ThreadImpl::setPriority(ThreadPriority::Enum prio) |
| 342 | { |
| 343 | BOOL rc = false; |
| 344 | switch(prio) |
| 345 | { |
| 346 | case ThreadPriority::eHIGH: |
| 347 | rc = SetThreadPriority(getThread(this)->thread, THREAD_PRIORITY_HIGHEST); |
| 348 | break; |
| 349 | case ThreadPriority::eABOVE_NORMAL: |
| 350 | rc = SetThreadPriority(getThread(this)->thread, THREAD_PRIORITY_ABOVE_NORMAL); |
| 351 | break; |
| 352 | case ThreadPriority::eNORMAL: |
| 353 | rc = SetThreadPriority(getThread(this)->thread, THREAD_PRIORITY_NORMAL); |
| 354 | break; |
| 355 | case ThreadPriority::eBELOW_NORMAL: |
| 356 | rc = SetThreadPriority(getThread(this)->thread, THREAD_PRIORITY_BELOW_NORMAL); |
| 357 | break; |
| 358 | case ThreadPriority::eLOW: |
| 359 | rc = SetThreadPriority(getThread(this)->thread, THREAD_PRIORITY_LOWEST); |
| 360 | break; |
| 361 | default: |
| 362 | break; |
| 363 | } |
| 364 | if(!rc) |
| 365 | { |
| 366 | physx::shdfnd::getFoundation().error(PxErrorCode::eINTERNAL_ERROR, __FILE__, __LINE__, |
| 367 | "PsWindowsThread::setPriority: Failed to set thread priority."); |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | ThreadPriority::Enum ThreadImpl::getPriority(Id threadId) |
| 372 | { |