| 701:936e5487418a | 702:ee80191310ca |
|---|---|
| 62 | 62 |
| 63 return ev; | 63 return ev; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ev_instance_wait(EventHandler *h) { | 66 void ev_instance_wait(EventHandler *h) { |
| 67 EventHandlerLinux *ev = (EventHandlerLinux*)h; | 67 EventHandlerSolaris *ev = (EventHandlerSolaris*)h; |
| 68 void *ret; | 68 void *ret; |
| 69 pthread_join(ev->thr, &ret); | 69 pthread_join(ev->thr, &ret); |
| 70 } | 70 } |
| 71 | 71 |
| 72 static volatile int ev_close = 0; | 72 static volatile int ev_close = 0; |
| 105 } | 105 } |
| 106 continue; | 106 continue; |
| 107 } | 107 } |
| 108 | 108 |
| 109 int numfinished = 0; | 109 int numfinished = 0; |
| 110 ev->numret = 0; | 110 ev->base.numret = 0; |
| 111 for(int i=0;i<nev;i++) { | 111 for(int i=0;i<nev;i++) { |
| 112 Event *event = events[i].portev_user; | 112 Event *event = events[i].portev_user; |
| 113 if(events[i].portev_source == PORT_SOURCE_AIO) { | 113 if(events[i].portev_source == PORT_SOURCE_AIO) { |
| 114 aiocb_t *aiocb = (aiocb_t*)events[i].portev_object; | 114 aiocb_t *aiocb = (aiocb_t*)events[i].portev_object; |
| 115 if(event) { | 115 if(event) { |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 free(aiocb); | 125 free(aiocb); |
| 126 } else { | 126 } else { |
| 127 if(event->fn) { | 127 if(event->fn) { |
| 128 if(event->fn(ev, event)) { | 128 if(event->fn((EventHandler*)ev, event)) { |
| 129 /* | 129 /* |
| 130 * on solaris we have to reassociate the fd after | 130 * on solaris we have to reassociate the fd after |
| 131 * each event | 131 * each event |
| 132 * we do this if the event function returns 1 | 132 * we do this if the event function returns 1 |
| 133 */ | 133 */ |
| 151 // call event finish handlers | 151 // call event finish handlers |
| 152 for(int i=0;i<numfinished;i++) { | 152 for(int i=0;i<numfinished;i++) { |
| 153 Event *event = finished[i]; | 153 Event *event = finished[i]; |
| 154 // check again if the finish callback is set | 154 // check again if the finish callback is set |
| 155 if(finished[i]->finish) { | 155 if(finished[i]->finish) { |
| 156 finished[i]->finish(ev, event); | 156 finished[i]->finish((EventHandler*)ev, event); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 // execute return calls | 159 // execute return calls |
| 160 for(int i=0;i<ev->base.numret;i++) { | 160 for(int i=0;i<ev->base.numret;i++) { |
| 161 EVReturn ret = ev->base.fnreturn[i]; | 161 EVReturn ret = ev->base.fnreturn[i]; |
| 213 event->events = 0; | 213 event->events = 0; |
| 214 return port_send(ev->port, 0, event); | 214 return port_send(ev->port, 0, event); |
| 215 } | 215 } |
| 216 | 216 |
| 217 static int ev_aio(int fd, aiocb_s *cb, WSBool read) { | 217 static int ev_aio(int fd, aiocb_s *cb, WSBool read) { |
| 218 EventHandlerSolaris *ev = cb->evhandler; | 218 EventHandlerSolaris *ev = (EventHandlerSolaris*)cb->evhandler; |
| 219 if(!ev) { | 219 if(!ev) { |
| 220 return -1; | 220 return -1; |
| 221 } | 221 } |
| 222 | 222 |
| 223 aiocb_t *aiocb = malloc(sizeof(aiocb_t)); | 223 aiocb_t *aiocb = malloc(sizeof(aiocb_t)); |