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:
commit
bb36fe7d3c
@ -64,6 +64,7 @@ using namespace OpenThreads;
|
||||
# define DPRINTF(arg)
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Initialize the static unique ids.
|
||||
//
|
||||
@ -191,7 +192,7 @@ private:
|
||||
int status = pthread_setspecific(PThreadPrivateData::s_tls_key, thread);
|
||||
if (status)
|
||||
{
|
||||
printf("Error: pthread_setspecific(,) returned error status, status = %d\n",status);
|
||||
printf("Error: pthread_setspecific(,) returned error status, status = %d\n",status);
|
||||
}
|
||||
|
||||
pthread_cleanup_push(thread_cleanup_handler, &tcs);
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user