114 if(!event->fn(ev, event)) { |
114 if(!event->fn(ev, event)) { |
115 // event fn returned 0 -> remove event from epoll |
115 // event fn returned 0 -> remove event from epoll |
116 if(epoll_ctl(ep, EPOLL_CTL_DEL, event->object, NULL)) { |
116 if(epoll_ctl(ep, EPOLL_CTL_DEL, event->object, NULL)) { |
117 perror("epoll_ctl"); |
117 perror("epoll_ctl"); |
118 } |
118 } |
|
119 |
|
120 // if set, execute event->finish |
|
121 if(event->finish) { |
|
122 event->finish(ev, event); |
|
123 } |
119 } |
124 } |
120 } |
125 } |
121 } |
126 } |
122 } |
127 } |
123 } |
128 } |