Merge pull request 'some bugfixes for custom CSP router' (#518) from custom_csp_router_task into develop
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #518
This commit is contained in:
Robin Müller 2023-03-24 14:55:12 +01:00
commit 82a9dbd632

View File

@ -354,6 +354,11 @@ ReturnValue_t CspComIF::startRouterTask() {
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
res = pthread_attr_setschedpolicy(&attr, SCHED_RR);
if (res) {
@ -369,17 +374,18 @@ ReturnValue_t CspComIF::startRouterTask() {
return returnvalue::FAILED;
}
res = pthread_setname_np(pthread_self(), routerTaskName);
res = pthread_create(&routerTaskHandle, &attr, routerWorkWrapper, NULL);
if (res) {
pthread_attr_destroy(&attr);
return returnvalue::FAILED;
}
res = pthread_create(&routerTaskHandle, &attr, routerWorkWrapper, NULL);
pthread_attr_destroy(&attr);
res = pthread_setname_np(routerTaskHandle, routerTaskName);
if (res) {
pthread_attr_destroy(&attr);
return returnvalue::FAILED;
}
pthread_attr_destroy(&attr);
return returnvalue::OK;
}