From f51ff1e051f7930fe3845ad10aad972d0c3d2e1b Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Mon, 22 Jun 2015 15:03:15 +0100 Subject: [PATCH] Replace pthread_setschedprio for osx, as it doesn't exist --- Source/Ember/Renderer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Ember/Renderer.cpp b/Source/Ember/Renderer.cpp index 8bc9fab..a8de9d9 100644 --- a/Source/Ember/Renderer.cpp +++ b/Source/Ember/Renderer.cpp @@ -1215,8 +1215,12 @@ EmberStats Renderer::Iterate(size_t iterCount, size_t temporalSample parallel_for(size_t(0), m_ThreadsToUse, [&] (size_t threadIndex) { #endif -#ifdef WIN32 +#if defined(WIN32) SetThreadPriority(GetCurrentThread(), m_Priority); +#elif defined(__APPLE__) + sched_param sp = {0}; + sp.sched_priority = m_Priority; + pthread_setschedparam(pthread_self(), SCHED_RR, &sp); #else pthread_setschedprio(pthread_self(), (int)m_Priority); #endif