some bugfixes
This commit is contained in:
parent
69bb3922d3
commit
7dc587e2df
@ -354,6 +354,11 @@ ReturnValue_t CspComIF::startRouterTask() {
|
|||||||
|
|
||||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||||
|
|
||||||
|
res = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
|
||||||
|
if (res != 0) {
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
// Set scheduling policy to SCHED_RR
|
// Set scheduling policy to SCHED_RR
|
||||||
res = pthread_attr_setschedpolicy(&attr, SCHED_RR);
|
res = pthread_attr_setschedpolicy(&attr, SCHED_RR);
|
||||||
if (res) {
|
if (res) {
|
||||||
@ -369,17 +374,18 @@ ReturnValue_t CspComIF::startRouterTask() {
|
|||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = pthread_setname_np(pthread_self(), routerTaskName);
|
res = pthread_create(&routerTaskHandle, &attr, routerWorkWrapper, NULL);
|
||||||
if (res) {
|
if (res) {
|
||||||
pthread_attr_destroy(&attr);
|
pthread_attr_destroy(&attr);
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = pthread_create(&routerTaskHandle, &attr, routerWorkWrapper, NULL);
|
res = pthread_setname_np(routerTaskHandle, routerTaskName);
|
||||||
pthread_attr_destroy(&attr);
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
pthread_attr_destroy(&attr);
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
pthread_attr_destroy(&attr);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user