Skip to content
Snippets Groups Projects
Commit 06daa336 authored by Dan Egnor's avatar Dan Egnor
Browse files

Better comments; zero data pointer when cancelling events to help conservative GC do its job better

parent c8927cd3
No related branches found
No related tags found
No related merge requests found
...@@ -69,8 +69,10 @@ typedef struct oop_source_sys oop_source_sys; ...@@ -69,8 +69,10 @@ typedef struct oop_source_sys oop_source_sys;
oop_source_sys *oop_sys_new(void); oop_source_sys *oop_sys_new(void);
/* Process events until either of the following two conditions: /* Process events until either of the following two conditions:
1 -- some callback returns non-NULL; will return the value in question. 1 -- some callback returns anything but OOP_CONTINUE;
2 -- no callbacks are registered; will return NULL. */ will return the value in question.
2 -- no callbacks are registered; will return OOP_CONTINUE.
3 -- an error occurs; will return OOP_ERROR (check errno). */
void *oop_sys_run(oop_source_sys *); void *oop_sys_run(oop_source_sys *);
/* Delete a system event source. No callbacks may be registered. */ /* Delete a system event source. No callbacks may be registered. */
......
...@@ -101,6 +101,7 @@ static void sys_cancel_fd(oop_source *source,int fd,oop_event ev) { ...@@ -101,6 +101,7 @@ static void sys_cancel_fd(oop_source *source,int fd,oop_event ev) {
oop_source_sys *sys = verify_source(source); oop_source_sys *sys = verify_source(source);
if (fd < sys->num_files && NULL != sys->files[fd][ev].f) { if (fd < sys->num_files && NULL != sys->files[fd][ev].f) {
sys->files[fd][ev].f = NULL; sys->files[fd][ev].f = NULL;
sys->files[fd][ev].v = NULL;
--sys->num_events; --sys->num_events;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment