Allow creating regular threads #140

Merged
muellerr merged 8 commits from allow_creating_regular_threads into develop 2023-03-24 14:15:54 +01:00
Showing only changes of commit a937b457f9 - Show all commits

View File

@ -186,6 +186,14 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
if (status != 0) {
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
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning
@ -195,14 +203,6 @@ void PosixThread::createTask(void* (*fnc_)(void*), void* arg_) {
#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
sigset_t waitSignal;
sigemptyset(&waitSignal);