this is so confusing

This commit is contained in:
Robin Müller 2023-03-24 14:10:47 +01:00
parent 4415dc24e1
commit a937b457f9
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -186,6 +186,14 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
if (status != 0) { if (status != 0) {
utility::printUnixErrorGeneric(CLASS_NAME, "createTask", "pthread_attr_setschedpolicy"); utility::printUnixErrorGeneric(CLASS_NAME, "createTask", "pthread_attr_setschedpolicy");
} }
sched_param scheduleParams;
scheduleParams.sched_priority = priority;
status = pthread_attr_setschedparam(&attributes, &scheduleParams);
if (status != 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "PosixThread: Setting priority failed" << std::endl;
#endif
}
#else #else
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning sif::warning
@ -195,14 +203,6 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
#endif #endif
} }
sched_param scheduleParams;
scheduleParams.__sched_priority = priority;
status = pthread_attr_setschedparam(&attributes, &scheduleParams);
if (status != 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "PosixThread: Setting priority failed" << std::endl;
#endif
}
// Set Signal Mask for suspend until startTask is called // Set Signal Mask for suspend until startTask is called
sigset_t waitSignal; sigset_t waitSignal;
sigemptyset(&waitSignal); sigemptyset(&waitSignal);