[Top][All Lists]

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

[lwip-devel] [bug #19167] tcp timeout handler can cause crash being invo

From: Andreas Becker
Subject: [lwip-devel] [bug #19167] tcp timeout handler can cause crash being invoked by sys_sem_wait()
Date: Wed, 28 Feb 2007 15:05:55 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.4 (like Gecko) (Debian)

Follow-up Comment #5, bug #19167 (project lwip):

Sorry for my word time-stamp. I don't want to use absolute timeouts, because
it will be hard to handle if the systime is later than ->expires. Blocked for
a (long) time...

I would prefer to keep the old timeout handling. Only to know how long a task
was running.

typedef u32_t timestamp_t; 
#define TIMESTAMP_DIFF(t1, t2) ((timestamp_t)((t1) - (t2))) 
/* No problem with timer overrun, if executed every INT32U_MAX/2 -> ca.
24days @1ms timertick*/

timeouts = sys_arch_timeouts();

timestamp_t diff = TIMESTAMP_DIFF(sys_time_now(), timeouts->remember)


  if (!timeouts || !timeouts->next) {
    sys_arch_mbox_fetch(mbox, msg, 0);
  } else {
    /* ANDREAS -> execute old pending timeouts */
    if (timeouts->next->time > diff) {
      diff -= timeouts->next->time;
      time = SYS_ARCH_TIMEOUT;
    } else {
      timeouts->next->time -= diff;
      time = sys_arch_mbox_fetch(mbox, msg, timeouts->next->time);

  if (time == SYS_ARCH_TIMEOUT) {
    /* Do the timer_Handler stuff */
    --> see sys_mbox_fetch()
  } else {
   timeouts->remember = sys_time_now();
   /* No more stuff like timeouts->next->time ... needed */


Reply to this item at:


  Nachricht geschickt von/durch Savannah

reply via email to

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