Changeset 6492d5caf9dd0d182d061d1650520854f06e2b72

Show
Ignore:
Timestamp:
09/16/09 03:55:29 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1253073329 +0000
git-parent:

[914f04715e543bf76101c324e06a062e7a10b3ba]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1253073329 +0000
Message:

kqueue apparently gets confused sometimes (perhaps just on Mac), closes #178

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/eventer/eventer_kqueue_impl.c

    r1295e5f r6492d5c  
    122122 
    123123  EV_SET(kep, ident, filter, flags, 0, 0, (void *)e->fd); 
     124  noitL(eventer_deb, "debug: ke_change(fd:%d, filt:%x, flags:%x)\n", 
     125        ident, filter, flags); 
    124126  if(kqs == master_kqs) pthread_mutex_unlock(&kqs_lock); 
    125127} 
     
    297299 
    298300  gettimeofday(&__now, NULL); 
    299   oldmask = e->mask; 
     301  /* We're going to lie to ourselves.  You'd think this should be: 
     302   * oldmask = e->mask;  However, we just fired with masks[fd], so 
     303   * kqueue is clearly looking for all of the events in masks[fd]. 
     304   * So, we combine them "just to be safe." 
     305   */ 
     306  oldmask = e->mask | masks[fd]; 
    300307  cbname = eventer_name_for_callback(e->callback); 
    301308  noitLT(eventer_deb, &__now, "kqueue: fire on %d/%x to %s(%p)\n", 
     
    318325    } 
    319326    else if(oldmask & EVENTER_WRITE) 
    320         ke_change(fd, EVFILT_WRITE, EV_DELETE | EV_DISABLE, e); 
     327      ke_change(fd, EVFILT_WRITE, EV_DELETE | EV_DISABLE, e); 
    321328 
    322329    /* Set our mask */