Changeset 1116

Show
Ignore:
Timestamp:
12/29/07 15:34:27 (10 months ago)
Author:
ahu
Message:

fix subtle bug with repeated timeouts on same fd

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/mtasker.cc

    r972 r1116  
    302302      if(i->ttd && (unsigned int)i->ttd < now) { 
    303303        d_waitstatus=TimeOut; 
    304         if(swapcontext(&d_kernel,i->context)) { // swaps back to the above point 'A' 
     304        ucontext_t* uc = i->context; 
     305        ttdindex.erase(i++);                  // removes the waitpoint  
     306 
     307        if(swapcontext(&d_kernel, uc)) { // swaps back to the above point 'A' 
    305308          perror("swapcontext in schedule2"); 
    306309          exit(EXIT_FAILURE); 
    307310        } 
    308         delete i->context;               
    309         ttdindex.erase(i++);                  // removes the waitpoint  
     311        delete uc; 
    310312      } 
    311313      else if(i->ttd)