task IF is set now
This commit is contained in:
parent
7a24f89915
commit
cb970b1883
@ -101,13 +101,14 @@ void PeriodicTask::taskFunctionality() {
|
|||||||
if(terminateThread.load()) {
|
if(terminateThread.load()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (ObjectList::iterator it = objectList.begin();
|
for (const auto& object: objectList) {
|
||||||
it != objectList.end(); ++it) {
|
object->performOperation();
|
||||||
(*it)->performOperation();
|
|
||||||
}
|
}
|
||||||
if(not delayForInterval(¤tStartTime, periodChrono)) {
|
if(not delayForInterval(¤tStartTime, periodChrono)) {
|
||||||
|
#ifdef DEBUG
|
||||||
sif::warning << "PeriodicTask: " << taskName <<
|
sif::warning << "PeriodicTask: " << taskName <<
|
||||||
" missed deadline!\n" << std::flush;
|
" missed deadline!\n" << std::flush;
|
||||||
|
#endif
|
||||||
if(deadlineMissedFunc != nullptr) {
|
if(deadlineMissedFunc != nullptr) {
|
||||||
this->deadlineMissedFunc();
|
this->deadlineMissedFunc();
|
||||||
}
|
}
|
||||||
@ -121,6 +122,7 @@ ReturnValue_t PeriodicTask::addComponent(object_id_t object) {
|
|||||||
if (newObject == nullptr) {
|
if (newObject == nullptr) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
newObject->setTaskIF(this);
|
||||||
objectList.push_back(newObject);
|
objectList.push_back(newObject);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user