Hello everyone,
I am using Rational Rhapsody Developer for C (version 8.1.3) and FreeRTOS on our Project. In the Project there are 20 tasks (20 different classes).
While the application running, the code crashes after a while and I’ve seen that the code can’t exit while loop; (pReactive can’t be equal curDest)
RiCBoolean RiCTimerManager_unschedTm(RiCTimerManager* const me, RiCEventId id, struct RiCReactive_t * const pReactive) {
/*#[ operation unschedTm(RiCEventId,struct RiCReactive_t * const) */
RiCBoolean unschedTmRes = RiCFALSE;
if(me != NULL){
RiCEvent *currentTm = me->timeouts;
RiCEvent *previousTm = NULL;
/* critical section for the timeouts structure */
RiCOSMutex_lock(&(me->CSMutex));
/*LDRA_INSPECTED 53 D : Pointer is initialized before use */
/*LDRA_INSPECTED 69 D : Variable is assigned before use */
while (currentTm !=NULL)
{
RiCEventId curId = RiCTimeout_getTimeoutId(currentTm);
const RiCReactive * const curDest = RiCEvent_getDestination(currentTm);
if(((id == curId) || (id == RiCAnyEvent_id)) && (pReactive == curDest)){
/* remove tm from list */
if(currentTm == me->timeouts){ /* first item */
me->timeouts = RiCTimeout_getNextTm(currentTm);
}
else{
/*LDRA_INSPECTED 45 D : Variable is checked inside of function */
RiCTimeout_setNextTm(previousTm, RiCTimeout_getNextTm(currentTm));
}
/* delete tm */
RiCTimeout_setNextTm(currentTm, NULL);
RiCTimeout_destroy(currentTm);
if(id != RiCAnyEvent_id){
currentTm = NULL;
}
unschedTmRes = RiCTRUE;
}
if (currentTm !=NULL)
{
previousTm = currentTm;
currentTm = RiCTimeout_getNextTm(currentTm);
}
}
/* critical section for the timeouts structure */
RiCOSMutex_free(&(me->CSMutex));
}
return unschedTmRes;
/*#]*/
}
Any idea what may cause this problem?
Thanks in advance.