lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] Timer problem!!!


From: Jani Monoses
Subject: [lwip-users] Re: [lwip] Timer problem!!!
Date: Wed, 08 Jan 2003 23:34:37 -0000

>    2) Now, for the function calls sys_arch_sem_wait() & 
> sys_arch_mbox_fetch(). I have added my RTOS calls with the timeout 
> values ('cause my RTOS suports blocking on a resource).
> 
> The question here is, how does Lwip use sys_timeouts() to know 
> which has reached the elapsed time to be zero. And when does the 
> handle for this gets excuted.

look in sys_sem_wait and sys_mbox_fetch which wrap the arch dependent primitives

as long as there are registered timeouts in sys_timeouts linked list that list 
is walked
and entries deleted when say that amount of time passed.That is done by 
succesively calling
the low level primitive(say sys_arch_sem_wait) with the timeout value of the 
entry in the list
when there are no more entries and the condition is not satisified (semaphore 
held by other thread
or mbox empty) then the low level primitive is called without timeout (value 0) 
so it stays there 
until woken up.
The low level needs to pass up the amount of time waited so that the upper 
level can substract that value
from the sys_timeout entry in the list whose time it was currently eating.
Look at the code for the details.
Jani


[This message was sent through the lwip discussion list.]




reply via email to

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