task IF is set now

This commit is contained in:
Robin Müller 2020-09-05 21:24:59 +02:00
parent 7a24f89915
commit cb970b1883

View File

@ -101,13 +101,14 @@ void PeriodicTask::taskFunctionality() {
if(terminateThread.load()) {
break;
}
for (ObjectList::iterator it = objectList.begin();
it != objectList.end(); ++it) {
(*it)->performOperation();
for (const auto& object: objectList) {
object->performOperation();
}
if(not delayForInterval(&currentStartTime, periodChrono)) {
#ifdef DEBUG
sif::warning << "PeriodicTask: " << taskName <<
" missed deadline!\n" << std::flush;
#endif
if(deadlineMissedFunc != nullptr) {
this->deadlineMissedFunc();
}
@ -121,6 +122,7 @@ ReturnValue_t PeriodicTask::addComponent(object_id_t object) {
if (newObject == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
newObject->setTaskIF(this);
objectList.push_back(newObject);
return HasReturnvaluesIF::RETURN_OK;
}