lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] sys_arch_sem_wait


From: Fabian Koch
Subject: [lwip-users] sys_arch_sem_wait
Date: Tue, 29 Sep 2009 12:31:54 +0200


Hey all,

a short question about sys_arch_sem_wait(). When someone is waiting for it, and it gets an eror/deleted.
Is that a serious condition that shouldn't hapen or should it just return the usual SYS_ARCH_TIMEOUT?

At the moment we have an Assertion in there (in a define called "IF_DEBUG_HALT") and it sometimes fires in strange situations.

u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout){
        long                        lStart = (long)OsGetTime();
        unsigned char        bResult;
       
        if(!timeout){
                bResult = OsSemEnter((unsigned long)sem);
                if(!bResult){//invalid or deleted while waiting on
                        IF_DEBUG_HALT;
                }
        } else {
                bResult = OsSemWait((unsigned long)sem, timeout);
        }
        if(bResult){
                return((u32_t)(((long)OsGetTime()) - lStart));
        } else {
                return(SYS_ARCH_TIMEOUT);
        }
}

regards,
Fabian
reply via email to

[Prev in Thread] Current Thread [Next in Thread]