… | |
… | |
126 | #define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ |
126 | #define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ |
127 | #define MAX_BLOCKTIME 59.731 /* never wait longer than this time (to detect time jumps) */ |
127 | #define MAX_BLOCKTIME 59.731 /* never wait longer than this time (to detect time jumps) */ |
128 | #define PID_HASHSIZE 16 /* size of pid hash table, must be power of two */ |
128 | #define PID_HASHSIZE 16 /* size of pid hash table, must be power of two */ |
129 | /*#define CLEANUP_INTERVAL 300. /* how often to try to free memory and re-check fds */ |
129 | /*#define CLEANUP_INTERVAL 300. /* how often to try to free memory and re-check fds */ |
130 | |
130 | |
|
|
131 | #ifdef EV_H |
|
|
132 | # include EV_H |
|
|
133 | #else |
131 | #include "ev.h" |
134 | # include "ev.h" |
|
|
135 | #endif |
132 | |
136 | |
133 | #if __GNUC__ >= 3 |
137 | #if __GNUC__ >= 3 |
134 | # define expect(expr,value) __builtin_expect ((expr),(value)) |
138 | # define expect(expr,value) __builtin_expect ((expr),(value)) |
135 | # define inline inline |
139 | # define inline inline |
136 | #else |
140 | #else |
… | |
… | |
215 | int events; |
219 | int events; |
216 | } ANPENDING; |
220 | } ANPENDING; |
217 | |
221 | |
218 | #if EV_MULTIPLICITY |
222 | #if EV_MULTIPLICITY |
219 | |
223 | |
220 | struct ev_loop |
224 | struct ev_loop |
221 | { |
225 | { |
|
|
226 | ev_tstamp ev_rt_now; |
222 | # define VAR(name,decl) decl; |
227 | #define VAR(name,decl) decl; |
223 | # include "ev_vars.h" |
228 | #include "ev_vars.h" |
224 | }; |
|
|
225 | # undef VAR |
229 | #undef VAR |
|
|
230 | }; |
226 | # include "ev_wrap.h" |
231 | #include "ev_wrap.h" |
|
|
232 | |
|
|
233 | struct ev_loop default_loop_struct; |
|
|
234 | static struct ev_loop *default_loop; |
227 | |
235 | |
228 | #else |
236 | #else |
229 | |
237 | |
|
|
238 | ev_tstamp ev_rt_now; |
230 | # define VAR(name,decl) static decl; |
239 | #define VAR(name,decl) static decl; |
231 | # include "ev_vars.h" |
240 | #include "ev_vars.h" |
232 | # undef VAR |
241 | #undef VAR |
|
|
242 | |
|
|
243 | static int default_loop; |
233 | |
244 | |
234 | #endif |
245 | #endif |
235 | |
246 | |
236 | /*****************************************************************************/ |
247 | /*****************************************************************************/ |
237 | |
248 | |
… | |
… | |
262 | #endif |
273 | #endif |
263 | |
274 | |
264 | return ev_time (); |
275 | return ev_time (); |
265 | } |
276 | } |
266 | |
277 | |
|
|
278 | #if EV_MULTIPLICITY |
267 | ev_tstamp |
279 | ev_tstamp |
268 | ev_now (EV_P) |
280 | ev_now (EV_P) |
269 | { |
281 | { |
270 | return rt_now; |
282 | return ev_rt_now; |
271 | } |
283 | } |
|
|
284 | #endif |
272 | |
285 | |
273 | #define array_roundsize(type,n) ((n) | 4 & ~3) |
286 | #define array_roundsize(type,n) ((n) | 4 & ~3) |
274 | |
287 | |
275 | #define array_needsize(type,base,cur,cnt,init) \ |
288 | #define array_needsize(type,base,cur,cnt,init) \ |
276 | if (expect_false ((cnt) > cur)) \ |
289 | if (expect_false ((cnt) > cur)) \ |
… | |
… | |
509 | |
522 | |
510 | heap [k] = w; |
523 | heap [k] = w; |
511 | ((W)heap [k])->active = k + 1; |
524 | ((W)heap [k])->active = k + 1; |
512 | } |
525 | } |
513 | |
526 | |
|
|
527 | inline void |
|
|
528 | adjustheap (WT *heap, int N, int k, ev_tstamp at) |
|
|
529 | { |
|
|
530 | ev_tstamp old_at = heap [k]->at; |
|
|
531 | heap [k]->at = at; |
|
|
532 | |
|
|
533 | if (old_at < at) |
|
|
534 | downheap (heap, N, k); |
|
|
535 | else |
|
|
536 | upheap (heap, k); |
|
|
537 | } |
|
|
538 | |
514 | /*****************************************************************************/ |
539 | /*****************************************************************************/ |
515 | |
540 | |
516 | typedef struct |
541 | typedef struct |
517 | { |
542 | { |
518 | WL head; |
543 | WL head; |
… | |
… | |
561 | } |
586 | } |
562 | |
587 | |
563 | void |
588 | void |
564 | ev_feed_signal_event (EV_P_ int signum) |
589 | ev_feed_signal_event (EV_P_ int signum) |
565 | { |
590 | { |
|
|
591 | WL w; |
|
|
592 | |
566 | #if EV_MULTIPLICITY |
593 | #if EV_MULTIPLICITY |
567 | assert (("feeding signal events is only supported in the default loop", loop == default_loop)); |
594 | assert (("feeding signal events is only supported in the default loop", loop == default_loop)); |
568 | #endif |
595 | #endif |
569 | |
596 | |
570 | --signum; |
597 | --signum; |
… | |
… | |
579 | } |
606 | } |
580 | |
607 | |
581 | static void |
608 | static void |
582 | sigcb (EV_P_ struct ev_io *iow, int revents) |
609 | sigcb (EV_P_ struct ev_io *iow, int revents) |
583 | { |
610 | { |
584 | WL w; |
|
|
585 | int signum; |
611 | int signum; |
586 | |
612 | |
587 | #ifdef WIN32 |
613 | #ifdef WIN32 |
588 | recv (sigpipe [0], &revents, 1, MSG_DONTWAIT); |
614 | recv (sigpipe [0], &revents, 1, MSG_DONTWAIT); |
589 | #else |
615 | #else |
… | |
… | |
591 | #endif |
617 | #endif |
592 | gotsig = 0; |
618 | gotsig = 0; |
593 | |
619 | |
594 | for (signum = signalmax; signum--; ) |
620 | for (signum = signalmax; signum--; ) |
595 | if (signals [signum].gotsig) |
621 | if (signals [signum].gotsig) |
596 | sigevent (EV_A_ signum + 1); |
622 | ev_feed_signal_event (EV_A_ signum + 1); |
597 | } |
623 | } |
598 | |
624 | |
599 | static void |
625 | static void |
600 | siginit (EV_P) |
626 | siginit (EV_P) |
601 | { |
627 | { |
… | |
… | |
713 | if (!clock_gettime (CLOCK_MONOTONIC, &ts)) |
739 | if (!clock_gettime (CLOCK_MONOTONIC, &ts)) |
714 | have_monotonic = 1; |
740 | have_monotonic = 1; |
715 | } |
741 | } |
716 | #endif |
742 | #endif |
717 | |
743 | |
718 | rt_now = ev_time (); |
744 | ev_rt_now = ev_time (); |
719 | mn_now = get_clock (); |
745 | mn_now = get_clock (); |
720 | now_floor = mn_now; |
746 | now_floor = mn_now; |
721 | rtmn_diff = rt_now - mn_now; |
747 | rtmn_diff = ev_rt_now - mn_now; |
722 | |
748 | |
723 | if (methods == EVMETHOD_AUTO) |
749 | if (methods == EVMETHOD_AUTO) |
724 | if (!enable_secure () && getenv ("LIBEV_METHODS")) |
750 | if (!enable_secure () && getenv ("LIBEV_METHODS")) |
725 | methods = atoi (getenv ("LIBEV_METHODS")); |
751 | methods = atoi (getenv ("LIBEV_METHODS")); |
726 | else |
752 | else |
… | |
… | |
741 | #endif |
767 | #endif |
742 | #if EV_USE_SELECT |
768 | #if EV_USE_SELECT |
743 | if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods); |
769 | if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods); |
744 | #endif |
770 | #endif |
745 | |
771 | |
746 | ev_watcher_init (&sigev, sigcb); |
772 | ev_init (&sigev, sigcb); |
747 | ev_set_priority (&sigev, EV_MAXPRI); |
773 | ev_set_priority (&sigev, EV_MAXPRI); |
748 | } |
774 | } |
749 | } |
775 | } |
750 | |
776 | |
751 | void |
777 | void |
… | |
… | |
841 | } |
867 | } |
842 | |
868 | |
843 | #endif |
869 | #endif |
844 | |
870 | |
845 | #if EV_MULTIPLICITY |
871 | #if EV_MULTIPLICITY |
846 | struct ev_loop default_loop_struct; |
|
|
847 | static struct ev_loop *default_loop; |
|
|
848 | |
|
|
849 | struct ev_loop * |
872 | struct ev_loop * |
850 | #else |
873 | #else |
851 | static int default_loop; |
|
|
852 | |
|
|
853 | int |
874 | int |
854 | #endif |
875 | #endif |
855 | ev_default_loop (int methods) |
876 | ev_default_loop (int methods) |
856 | { |
877 | { |
857 | if (sigpipe [0] == sigpipe [1]) |
878 | if (sigpipe [0] == sigpipe [1]) |
… | |
… | |
943 | ANPENDING *p = pendings [pri] + --pendingcnt [pri]; |
964 | ANPENDING *p = pendings [pri] + --pendingcnt [pri]; |
944 | |
965 | |
945 | if (p->w) |
966 | if (p->w) |
946 | { |
967 | { |
947 | p->w->pending = 0; |
968 | p->w->pending = 0; |
948 | p->w->cb (EV_A_ p->w, p->events); |
969 | EV_CB_INVOKE (p->w, p->events); |
949 | } |
970 | } |
950 | } |
971 | } |
951 | } |
972 | } |
952 | |
973 | |
953 | static void |
974 | static void |
… | |
… | |
974 | } |
995 | } |
975 | |
996 | |
976 | static void |
997 | static void |
977 | periodics_reify (EV_P) |
998 | periodics_reify (EV_P) |
978 | { |
999 | { |
979 | while (periodiccnt && ((WT)periodics [0])->at <= rt_now) |
1000 | while (periodiccnt && ((WT)periodics [0])->at <= ev_rt_now) |
980 | { |
1001 | { |
981 | struct ev_periodic *w = periodics [0]; |
1002 | struct ev_periodic *w = periodics [0]; |
982 | |
1003 | |
983 | assert (("inactive timer on periodic heap detected", ev_is_active (w))); |
1004 | assert (("inactive timer on periodic heap detected", ev_is_active (w))); |
984 | |
1005 | |
985 | /* first reschedule or stop timer */ |
1006 | /* first reschedule or stop timer */ |
986 | if (w->reschedule_cb) |
1007 | if (w->reschedule_cb) |
987 | { |
1008 | { |
988 | ev_tstamp at = ((WT)w)->at = w->reschedule_cb (w, rt_now + 0.0001); |
1009 | ev_tstamp at = ((WT)w)->at = w->reschedule_cb (w, ev_rt_now + 0.0001); |
989 | |
1010 | |
990 | assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > rt_now)); |
1011 | assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > ev_rt_now)); |
991 | downheap ((WT *)periodics, periodiccnt, 0); |
1012 | downheap ((WT *)periodics, periodiccnt, 0); |
992 | } |
1013 | } |
993 | else if (w->interval) |
1014 | else if (w->interval) |
994 | { |
1015 | { |
995 | ((WT)w)->at += floor ((rt_now - ((WT)w)->at) / w->interval + 1.) * w->interval; |
1016 | ((WT)w)->at += floor ((ev_rt_now - ((WT)w)->at) / w->interval + 1.) * w->interval; |
996 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > rt_now)); |
1017 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now)); |
997 | downheap ((WT *)periodics, periodiccnt, 0); |
1018 | downheap ((WT *)periodics, periodiccnt, 0); |
998 | } |
1019 | } |
999 | else |
1020 | else |
1000 | ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1021 | ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1001 | |
1022 | |
… | |
… | |
1012 | for (i = 0; i < periodiccnt; ++i) |
1033 | for (i = 0; i < periodiccnt; ++i) |
1013 | { |
1034 | { |
1014 | struct ev_periodic *w = periodics [i]; |
1035 | struct ev_periodic *w = periodics [i]; |
1015 | |
1036 | |
1016 | if (w->reschedule_cb) |
1037 | if (w->reschedule_cb) |
1017 | ((WT)w)->at = w->reschedule_cb (w, rt_now); |
1038 | ((WT)w)->at = w->reschedule_cb (w, ev_rt_now); |
1018 | else if (w->interval) |
1039 | else if (w->interval) |
1019 | ((WT)w)->at += ceil ((rt_now - ((WT)w)->at) / w->interval) * w->interval; |
1040 | ((WT)w)->at += ceil ((ev_rt_now - ((WT)w)->at) / w->interval) * w->interval; |
1020 | } |
1041 | } |
1021 | |
1042 | |
1022 | /* now rebuild the heap */ |
1043 | /* now rebuild the heap */ |
1023 | for (i = periodiccnt >> 1; i--; ) |
1044 | for (i = periodiccnt >> 1; i--; ) |
1024 | downheap ((WT *)periodics, periodiccnt, i); |
1045 | downheap ((WT *)periodics, periodiccnt, i); |
… | |
… | |
1029 | { |
1050 | { |
1030 | mn_now = get_clock (); |
1051 | mn_now = get_clock (); |
1031 | |
1052 | |
1032 | if (expect_true (mn_now - now_floor < MIN_TIMEJUMP * .5)) |
1053 | if (expect_true (mn_now - now_floor < MIN_TIMEJUMP * .5)) |
1033 | { |
1054 | { |
1034 | rt_now = rtmn_diff + mn_now; |
1055 | ev_rt_now = rtmn_diff + mn_now; |
1035 | return 0; |
1056 | return 0; |
1036 | } |
1057 | } |
1037 | else |
1058 | else |
1038 | { |
1059 | { |
1039 | now_floor = mn_now; |
1060 | now_floor = mn_now; |
1040 | rt_now = ev_time (); |
1061 | ev_rt_now = ev_time (); |
1041 | return 1; |
1062 | return 1; |
1042 | } |
1063 | } |
1043 | } |
1064 | } |
1044 | |
1065 | |
1045 | static void |
1066 | static void |
… | |
… | |
1054 | { |
1075 | { |
1055 | ev_tstamp odiff = rtmn_diff; |
1076 | ev_tstamp odiff = rtmn_diff; |
1056 | |
1077 | |
1057 | for (i = 4; --i; ) /* loop a few times, before making important decisions */ |
1078 | for (i = 4; --i; ) /* loop a few times, before making important decisions */ |
1058 | { |
1079 | { |
1059 | rtmn_diff = rt_now - mn_now; |
1080 | rtmn_diff = ev_rt_now - mn_now; |
1060 | |
1081 | |
1061 | if (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP) |
1082 | if (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP) |
1062 | return; /* all is well */ |
1083 | return; /* all is well */ |
1063 | |
1084 | |
1064 | rt_now = ev_time (); |
1085 | ev_rt_now = ev_time (); |
1065 | mn_now = get_clock (); |
1086 | mn_now = get_clock (); |
1066 | now_floor = mn_now; |
1087 | now_floor = mn_now; |
1067 | } |
1088 | } |
1068 | |
1089 | |
1069 | periodics_reschedule (EV_A); |
1090 | periodics_reschedule (EV_A); |
… | |
… | |
1072 | } |
1093 | } |
1073 | } |
1094 | } |
1074 | else |
1095 | else |
1075 | #endif |
1096 | #endif |
1076 | { |
1097 | { |
1077 | rt_now = ev_time (); |
1098 | ev_rt_now = ev_time (); |
1078 | |
1099 | |
1079 | if (expect_false (mn_now > rt_now || mn_now < rt_now - MAX_BLOCKTIME - MIN_TIMEJUMP)) |
1100 | if (expect_false (mn_now > ev_rt_now || mn_now < ev_rt_now - MAX_BLOCKTIME - MIN_TIMEJUMP)) |
1080 | { |
1101 | { |
1081 | periodics_reschedule (EV_A); |
1102 | periodics_reschedule (EV_A); |
1082 | |
1103 | |
1083 | /* adjust timers. this is easy, as the offset is the same for all */ |
1104 | /* adjust timers. this is easy, as the offset is the same for all */ |
1084 | for (i = 0; i < timercnt; ++i) |
1105 | for (i = 0; i < timercnt; ++i) |
1085 | ((WT)timers [i])->at += rt_now - mn_now; |
1106 | ((WT)timers [i])->at += ev_rt_now - mn_now; |
1086 | } |
1107 | } |
1087 | |
1108 | |
1088 | mn_now = rt_now; |
1109 | mn_now = ev_rt_now; |
1089 | } |
1110 | } |
1090 | } |
1111 | } |
1091 | |
1112 | |
1092 | void |
1113 | void |
1093 | ev_ref (EV_P) |
1114 | ev_ref (EV_P) |
… | |
… | |
1133 | if (expect_true (have_monotonic)) |
1154 | if (expect_true (have_monotonic)) |
1134 | time_update_monotonic (EV_A); |
1155 | time_update_monotonic (EV_A); |
1135 | else |
1156 | else |
1136 | #endif |
1157 | #endif |
1137 | { |
1158 | { |
1138 | rt_now = ev_time (); |
1159 | ev_rt_now = ev_time (); |
1139 | mn_now = rt_now; |
1160 | mn_now = ev_rt_now; |
1140 | } |
1161 | } |
1141 | |
1162 | |
1142 | if (flags & EVLOOP_NONBLOCK || idlecnt) |
1163 | if (flags & EVLOOP_NONBLOCK || idlecnt) |
1143 | block = 0.; |
1164 | block = 0.; |
1144 | else |
1165 | else |
… | |
… | |
1151 | if (block > to) block = to; |
1172 | if (block > to) block = to; |
1152 | } |
1173 | } |
1153 | |
1174 | |
1154 | if (periodiccnt) |
1175 | if (periodiccnt) |
1155 | { |
1176 | { |
1156 | ev_tstamp to = ((WT)periodics [0])->at - rt_now + method_fudge; |
1177 | ev_tstamp to = ((WT)periodics [0])->at - ev_rt_now + method_fudge; |
1157 | if (block > to) block = to; |
1178 | if (block > to) block = to; |
1158 | } |
1179 | } |
1159 | |
1180 | |
1160 | if (block < 0.) block = 0.; |
1181 | if (block < 0.) block = 0.; |
1161 | } |
1182 | } |
1162 | |
1183 | |
1163 | method_poll (EV_A_ block); |
1184 | method_poll (EV_A_ block); |
1164 | |
1185 | |
1165 | /* update rt_now, do magic */ |
1186 | /* update ev_rt_now, do magic */ |
1166 | time_update (EV_A); |
1187 | time_update (EV_A); |
1167 | |
1188 | |
1168 | /* queue pending timers and reschedule them */ |
1189 | /* queue pending timers and reschedule them */ |
1169 | timers_reify (EV_A); /* relative timers called last */ |
1190 | timers_reify (EV_A); /* relative timers called last */ |
1170 | periodics_reify (EV_A); /* absolute timers called first */ |
1191 | periodics_reify (EV_A); /* absolute timers called first */ |
… | |
… | |
1316 | ev_timer_again (EV_P_ struct ev_timer *w) |
1337 | ev_timer_again (EV_P_ struct ev_timer *w) |
1317 | { |
1338 | { |
1318 | if (ev_is_active (w)) |
1339 | if (ev_is_active (w)) |
1319 | { |
1340 | { |
1320 | if (w->repeat) |
1341 | if (w->repeat) |
1321 | { |
|
|
1322 | ((WT)w)->at = mn_now + w->repeat; |
|
|
1323 | downheap ((WT *)timers, timercnt, ((W)w)->active - 1); |
1342 | adjustheap ((WT *)timers, timercnt, ((W)w)->active - 1, mn_now + w->repeat); |
1324 | } |
|
|
1325 | else |
1343 | else |
1326 | ev_timer_stop (EV_A_ w); |
1344 | ev_timer_stop (EV_A_ w); |
1327 | } |
1345 | } |
1328 | else if (w->repeat) |
1346 | else if (w->repeat) |
1329 | ev_timer_start (EV_A_ w); |
1347 | ev_timer_start (EV_A_ w); |
… | |
… | |
1334 | { |
1352 | { |
1335 | if (ev_is_active (w)) |
1353 | if (ev_is_active (w)) |
1336 | return; |
1354 | return; |
1337 | |
1355 | |
1338 | if (w->reschedule_cb) |
1356 | if (w->reschedule_cb) |
1339 | ((WT)w)->at = w->reschedule_cb (w, rt_now); |
1357 | ((WT)w)->at = w->reschedule_cb (w, ev_rt_now); |
1340 | else if (w->interval) |
1358 | else if (w->interval) |
1341 | { |
1359 | { |
1342 | assert (("ev_periodic_start called with negative interval value", w->interval >= 0.)); |
1360 | assert (("ev_periodic_start called with negative interval value", w->interval >= 0.)); |
1343 | /* this formula differs from the one in periodic_reify because we do not always round up */ |
1361 | /* this formula differs from the one in periodic_reify because we do not always round up */ |
1344 | ((WT)w)->at += ceil ((rt_now - ((WT)w)->at) / w->interval) * w->interval; |
1362 | ((WT)w)->at += ceil ((ev_rt_now - ((WT)w)->at) / w->interval) * w->interval; |
1345 | } |
1363 | } |
1346 | |
1364 | |
1347 | ev_start (EV_A_ (W)w, ++periodiccnt); |
1365 | ev_start (EV_A_ (W)w, ++periodiccnt); |
1348 | array_needsize (struct ev_periodic *, periodics, periodicmax, periodiccnt, (void)); |
1366 | array_needsize (struct ev_periodic *, periodics, periodicmax, periodiccnt, (void)); |
1349 | periodics [periodiccnt - 1] = w; |
1367 | periodics [periodiccnt - 1] = w; |
… | |
… | |
1371 | } |
1389 | } |
1372 | |
1390 | |
1373 | void |
1391 | void |
1374 | ev_periodic_again (EV_P_ struct ev_periodic *w) |
1392 | ev_periodic_again (EV_P_ struct ev_periodic *w) |
1375 | { |
1393 | { |
|
|
1394 | /* TODO: use adjustheap and recalculation */ |
1376 | ev_periodic_stop (EV_A_ w); |
1395 | ev_periodic_stop (EV_A_ w); |
1377 | ev_periodic_start (EV_A_ w); |
1396 | ev_periodic_start (EV_A_ w); |
1378 | } |
1397 | } |
1379 | |
1398 | |
1380 | void |
1399 | void |
… | |
… | |
1559 | else |
1578 | else |
1560 | { |
1579 | { |
1561 | once->cb = cb; |
1580 | once->cb = cb; |
1562 | once->arg = arg; |
1581 | once->arg = arg; |
1563 | |
1582 | |
1564 | ev_watcher_init (&once->io, once_cb_io); |
1583 | ev_init (&once->io, once_cb_io); |
1565 | if (fd >= 0) |
1584 | if (fd >= 0) |
1566 | { |
1585 | { |
1567 | ev_io_set (&once->io, fd, events); |
1586 | ev_io_set (&once->io, fd, events); |
1568 | ev_io_start (EV_A_ &once->io); |
1587 | ev_io_start (EV_A_ &once->io); |
1569 | } |
1588 | } |
1570 | |
1589 | |
1571 | ev_watcher_init (&once->to, once_cb_to); |
1590 | ev_init (&once->to, once_cb_to); |
1572 | if (timeout >= 0.) |
1591 | if (timeout >= 0.) |
1573 | { |
1592 | { |
1574 | ev_timer_set (&once->to, timeout, 0.); |
1593 | ev_timer_set (&once->to, timeout, 0.); |
1575 | ev_timer_start (EV_A_ &once->to); |
1594 | ev_timer_start (EV_A_ &once->to); |
1576 | } |
1595 | } |