- Timestamp:
- Jun 22, 2011, 12:37:21 AM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- bbb7876
- Parents:
- 074bdaa
- git-author:
- David Benjamin <davidben@mit.edu> (05/24/11 01:10:12)
- git-committer:
- David Benjamin <davidben@mit.edu> (06/22/11 00:37:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
select.c
r074bdaa rbcde7926 175 175 }; 176 176 177 int owl_select_add_perl_io_dispatch(int fd, int mode, SV *cb)178 {179 const owl_io_dispatch *d = owl_select_find_valid_io_dispatch_by_fd(fd);180 if (d != NULL && d->callback != owl_perlconfig_io_dispatch) {181 /* Don't mess with non-perl dispatch functions from here. */182 return 1;183 }184 /* Also remove any invalidated perl dispatch functions that may have185 * stuck around. */186 owl_select_remove_perl_io_dispatch(fd);187 owl_select_add_io_dispatch(fd, mode, owl_perlconfig_io_dispatch, owl_perlconfig_io_dispatch_destroy, cb);188 return 0;189 }190 191 static owl_io_dispatch *owl_select_find_perl_io_dispatch(int fd)192 {193 int i, len;194 const owl_list *dl;195 owl_io_dispatch *d;196 dl = owl_global_get_io_dispatch_list(&g);197 len = owl_list_get_size(dl);198 for(i = 0; i < len; i++) {199 d = owl_list_get_element(dl, i);200 if (d->fd == fd && d->callback == owl_perlconfig_io_dispatch)201 return d;202 }203 return NULL;204 }205 206 int owl_select_remove_perl_io_dispatch(int fd)207 {208 owl_io_dispatch *d = owl_select_find_perl_io_dispatch(fd);209 if (d != NULL) {210 /* Only remove perl io dispatchers from here. */211 owl_select_remove_io_dispatch(d);212 return 0;213 }214 return 1;215 }216 217 177 void owl_select_init(void) 218 178 {
Note: See TracChangeset
for help on using the changeset viewer.