mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 23:12:09 +00:00
Make sys_arch_sem_wait() & sys_arch_mbox_fetch() a little more robust when waiting (although this should never be a problem...)
This commit is contained in:
parent
66a84cb2ef
commit
597d5459bb
@ -101,6 +101,9 @@ u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout)
|
||||
LWIP_ASSERT("*sem > 0", *sem > 0);
|
||||
LWIP_ASSERT("expecting a semaphore count but it's 0", !expectSomething || (*sem > 1));
|
||||
ret++;
|
||||
if (ret == SYS_ARCH_TIMEOUT) {
|
||||
ret--;
|
||||
}
|
||||
} while(*sem == 1);
|
||||
}
|
||||
else
|
||||
@ -280,6 +283,9 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *q, void **msg, u32_t timeout)
|
||||
LWIP_ASSERT("q->used >= 0", q->used >= 0);
|
||||
LWIP_ASSERT("expecting item available but it's 0", !expectSomething || (q->used > 0));
|
||||
ret++;
|
||||
if (ret == SYS_ARCH_TIMEOUT) {
|
||||
ret--;
|
||||
}
|
||||
} while(q->used == 0);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user