Skip to content

Error with CoPendSem with timeout #1

@jvdb66

Description

@jvdb66

CoPendSem does not work with timeout in all situations.
curTCB->pmail = Co_NULL; needs to be added on line 243 in sem.c

        /* Block task until event or timeout occurs                       */
        EventTaskToWait(pecb,curTCB);
        InsertDelayList(curTCB,timeout);
        curTCB->pmail = Co_NULL; <------ ADD THIS
        OsSchedUnlock();
        if (curTCB->pmail == Co_NULL)  /* If pmail is Co_NULL, time-out occurred*/
        {
          return E_TIMEOUT; 
        }                               
        else                  /* Event occurred or event have been deleted*/    
        {
            OsSchedLock();
            curTCB->pmail = Co_NULL;
            pecb->eventCounter--; 
            OsSchedUnlock();
            return E_OK;    
        }               

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions