Changeset 1895c29 for owl.h


Ignore:
Timestamp:
Dec 17, 2008, 5:13:20 PM (15 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
cf0cc64
Parents:
f36cd97
git-author:
Nelson Elhage <nelhage@mit.edu> (12/17/08 16:58:41)
git-committer:
Nelson Elhage <nelhage@mit.edu> (12/17/08 17:13:20)
Message:
Fix owl_select_remove_dispatch bugs.

Fix two bugs in owl_select_remove_dispatch:

(1) Removing a dispatch from that dispatch's callback was bad, because
    it mutated the dispatch list while it was being traversed. Fix
    that by noting if we're in the middle of a dispatch, and deferring
    cleanup until later.
(2) Calling owl_free on dispatches in select.c is a strange API, since
    it doesn't allocate them in the first place. Since we now have
    destructors, make freeing the dispatch their job.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.h

    rf36cd97 r1895c29  
    527527typedef struct _owl_dispatch {
    528528  int fd;                                 /* FD to watch for dispatch. */
     529  int needs_gc;
    529530  void (*cfunc)(struct _owl_dispatch*);   /* C function to dispatch to. */
    530531  void (*destroy)(struct _owl_dispatch*); /* Destructor */
Note: See TracChangeset for help on using the changeset viewer.