Merge pull request #170 from crubel/PThreadPullRequest

Fixed compile time errors that occur when you have ALLOW_PRIORITY_SCHEDULING defined
This commit is contained in:
OpenSceneGraph git repository 2016-12-05 10:33:23 +00:00 committed by GitHub
commit bb36fe7d3c

View File

@ -64,6 +64,7 @@ using namespace OpenThreads;
# define DPRINTF(arg)
#endif
//-----------------------------------------------------------------------------
// Initialize the static unique ids.
//
@ -239,12 +240,12 @@ private:
if(status != 0) {
printf("THREAD INFO (%d) : Get sched: %s\n",
thread->getProcessId(),
(int)thread->getProcessId(),
strerror(status));
} else {
printf(
"THREAD INFO (%d) : Thread running at %s / Priority: %d\n",
thread->getProcessId(),
(int)thread->getProcessId(),
(my_policy == SCHED_FIFO ? "SCHEDULE_FIFO"
: (my_policy == SCHED_RR ? "SCHEDULE_ROUND_ROBIN"
: (my_policy == SCHED_OTHER ? "SCHEDULE_OTHER"
@ -256,9 +257,8 @@ private:
printf(
"THREAD INFO (%d) : Max priority: %d, Min priority: %d\n",
thread->getProcessId(),
(int)thread->getProcessId(),
max_priority, min_priority);
}
}
@ -266,7 +266,7 @@ private:
{
printf(
"THREAD INFO (%d) POSIX Priority scheduling not available\n",
thread->getProcessId());
(int)thread->getProcessId());
}
fflush(stdout);
@ -829,7 +829,7 @@ int Thread::setSchedulePriority(ThreadPriority priority) {
pd->threadPriority = priority;
if(pd->isRunning)
if(pd->isRunning())
return ThreadPrivateActions::SetThreadSchedulingParams(this);
else
return 0;
@ -869,7 +869,7 @@ int Thread::setSchedulePolicy(ThreadPolicy policy)
pd->threadPolicy = policy;
if(pd->isRunning)
if(pd->isRunning())
return ThreadPrivateActions::SetThreadSchedulingParams(this);
else
return 0;