Commit 7e56d208 authored by claes's avatar claes

Setting of priority fixed

parent f32cb308
...@@ -592,26 +592,17 @@ thread_SetPrio ( ...@@ -592,26 +592,17 @@ thread_SetPrio (
} }
#elif defined OS_LINUX #elif defined OS_LINUX
{ {
int pid, policy;
pthread_t tid; pthread_t tid;
char set[100];
struct sched_param par; struct sched_param par;
pwr_tStatus sts = THREAD__SUCCESS; pwr_tStatus sts = THREAD__SUCCESS;
/* Set priority and scheduling mechanism for thread. */ /* Set priority and scheduling mechanism for thread. */
/* -f equals SCHED_FIFO */
pid = getpid();
tid = pthread_self(); tid = pthread_self();
prio = MIN(sched_get_priority_max(SCHED_FIFO), prio = MIN(sched_get_priority_max(SCHED_FIFO),
sched_get_priority_min(SCHED_FIFO) + prio); sched_get_priority_min(SCHED_FIFO) + prio);
// sprintf(set, "/home/rk8584/sched/nptlrt -fp %i %i", prio, tid);
// system(set);
par.sched_priority = prio; par.sched_priority = prio;
pthread_setschedparam(tid, SCHED_FIFO, &par); pthread_setschedparam(tid, SCHED_FIFO, &par);
pthread_getschedparam(tid, &policy, &par);
errh_Info("My policy: %s, prio: %d" , policy != SCHED_OTHER ? "RT" : "OTHER", par.sched_priority);
return sts; return sts;
} }
#else #else
# error Not defined for this platform ! # error Not defined for this platform !
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment