MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / setPriority

Method setPriority

physx/source/foundation/src/windows/PsWindowsThread.cpp:341–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341void 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
371ThreadPriority::Enum ThreadImpl::getPriority(Id threadId)
372{

Callers

nothing calls this directly

Calls 2

errorMethod · 0.80
getThreadFunction · 0.70

Tested by

no test coverage detected