… | |
… | |
476 | pendings [pri][w_->pending - 1].w = w_; |
476 | pendings [pri][w_->pending - 1].w = w_; |
477 | pendings [pri][w_->pending - 1].events = revents; |
477 | pendings [pri][w_->pending - 1].events = revents; |
478 | } |
478 | } |
479 | } |
479 | } |
480 | |
480 | |
481 | void inline_size |
481 | void inline_speed |
482 | queue_events (EV_P_ W *events, int eventcnt, int type) |
482 | queue_events (EV_P_ W *events, int eventcnt, int type) |
483 | { |
483 | { |
484 | int i; |
484 | int i; |
485 | |
485 | |
486 | for (i = 0; i < eventcnt; ++i) |
486 | for (i = 0; i < eventcnt; ++i) |
… | |
… | |
638 | void inline_speed |
638 | void inline_speed |
639 | upheap (WT *heap, int k) |
639 | upheap (WT *heap, int k) |
640 | { |
640 | { |
641 | WT w = heap [k]; |
641 | WT w = heap [k]; |
642 | |
642 | |
643 | while (k && heap [k >> 1]->at > w->at) |
643 | while (k) |
644 | { |
644 | { |
|
|
645 | int p = (k - 1) >> 1; |
|
|
646 | |
|
|
647 | if (heap [p]->at <= w->at) |
|
|
648 | break; |
|
|
649 | |
645 | heap [k] = heap [k >> 1]; |
650 | heap [k] = heap [p]; |
646 | ((W)heap [k])->active = k + 1; |
651 | ((W)heap [k])->active = k + 1; |
647 | k >>= 1; |
652 | k = p; |
648 | } |
653 | } |
649 | |
654 | |
650 | heap [k] = w; |
655 | heap [k] = w; |
651 | ((W)heap [k])->active = k + 1; |
656 | ((W)heap [k])->active = k + 1; |
652 | |
|
|
653 | } |
657 | } |
654 | |
658 | |
655 | void inline_speed |
659 | void inline_speed |
656 | downheap (WT *heap, int N, int k) |
660 | downheap (WT *heap, int N, int k) |
657 | { |
661 | { |
658 | WT w = heap [k]; |
662 | WT w = heap [k]; |
659 | |
663 | |
660 | while (k < (N >> 1)) |
664 | for (;;) |
661 | { |
665 | { |
662 | int j = k << 1; |
666 | int c = (k << 1) + 1; |
663 | |
667 | |
664 | if (j + 1 < N && heap [j]->at > heap [j + 1]->at) |
668 | if (c >= N) |
665 | ++j; |
|
|
666 | |
|
|
667 | if (w->at <= heap [j]->at) |
|
|
668 | break; |
669 | break; |
669 | |
670 | |
|
|
671 | c += c + 1 < N && heap [c]->at > heap [c + 1]->at |
|
|
672 | ? 1 : 0; |
|
|
673 | |
|
|
674 | if (w->at <= heap [c]->at) |
|
|
675 | break; |
|
|
676 | |
670 | heap [k] = heap [j]; |
677 | heap [k] = heap [c]; |
671 | ((W)heap [k])->active = k + 1; |
678 | ((W)heap [k])->active = k + 1; |
|
|
679 | |
672 | k = j; |
680 | k = c; |
673 | } |
681 | } |
674 | |
682 | |
675 | heap [k] = w; |
683 | heap [k] = w; |
676 | ((W)heap [k])->active = k + 1; |
684 | ((W)heap [k])->active = k + 1; |
677 | } |
685 | } |
… | |
… | |
1206 | void inline_size |
1214 | void inline_size |
1207 | timers_reify (EV_P) |
1215 | timers_reify (EV_P) |
1208 | { |
1216 | { |
1209 | while (timercnt && ((WT)timers [0])->at <= mn_now) |
1217 | while (timercnt && ((WT)timers [0])->at <= mn_now) |
1210 | { |
1218 | { |
1211 | ev_timer *w = timers [0]; |
1219 | ev_timer *w = (ev_timer *)timers [0]; |
1212 | |
1220 | |
1213 | /*assert (("inactive timer on timer heap detected", ev_is_active (w)));*/ |
1221 | /*assert (("inactive timer on timer heap detected", ev_is_active (w)));*/ |
1214 | |
1222 | |
1215 | /* first reschedule or stop timer */ |
1223 | /* first reschedule or stop timer */ |
1216 | if (w->repeat) |
1224 | if (w->repeat) |
… | |
… | |
1219 | |
1227 | |
1220 | ((WT)w)->at += w->repeat; |
1228 | ((WT)w)->at += w->repeat; |
1221 | if (((WT)w)->at < mn_now) |
1229 | if (((WT)w)->at < mn_now) |
1222 | ((WT)w)->at = mn_now; |
1230 | ((WT)w)->at = mn_now; |
1223 | |
1231 | |
1224 | downheap ((WT *)timers, timercnt, 0); |
1232 | downheap (timers, timercnt, 0); |
1225 | } |
1233 | } |
1226 | else |
1234 | else |
1227 | ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1235 | ev_timer_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1228 | |
1236 | |
1229 | ev_feed_event (EV_A_ (W)w, EV_TIMEOUT); |
1237 | ev_feed_event (EV_A_ (W)w, EV_TIMEOUT); |
… | |
… | |
1234 | void inline_size |
1242 | void inline_size |
1235 | periodics_reify (EV_P) |
1243 | periodics_reify (EV_P) |
1236 | { |
1244 | { |
1237 | while (periodiccnt && ((WT)periodics [0])->at <= ev_rt_now) |
1245 | while (periodiccnt && ((WT)periodics [0])->at <= ev_rt_now) |
1238 | { |
1246 | { |
1239 | ev_periodic *w = periodics [0]; |
1247 | ev_periodic *w = (ev_periodic *)periodics [0]; |
1240 | |
1248 | |
1241 | /*assert (("inactive timer on periodic heap detected", ev_is_active (w)));*/ |
1249 | /*assert (("inactive timer on periodic heap detected", ev_is_active (w)));*/ |
1242 | |
1250 | |
1243 | /* first reschedule or stop timer */ |
1251 | /* first reschedule or stop timer */ |
1244 | if (w->reschedule_cb) |
1252 | if (w->reschedule_cb) |
1245 | { |
1253 | { |
1246 | ((WT)w)->at = w->reschedule_cb (w, ev_rt_now + TIME_EPSILON); |
1254 | ((WT)w)->at = w->reschedule_cb (w, ev_rt_now + TIME_EPSILON); |
1247 | assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > ev_rt_now)); |
1255 | assert (("ev_periodic reschedule callback returned time in the past", ((WT)w)->at > ev_rt_now)); |
1248 | downheap ((WT *)periodics, periodiccnt, 0); |
1256 | downheap (periodics, periodiccnt, 0); |
1249 | } |
1257 | } |
1250 | else if (w->interval) |
1258 | else if (w->interval) |
1251 | { |
1259 | { |
1252 | ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; |
1260 | ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; |
1253 | if (((WT)w)->at - ev_rt_now <= TIME_EPSILON) ((WT)w)->at += w->interval; |
1261 | if (((WT)w)->at - ev_rt_now <= TIME_EPSILON) ((WT)w)->at += w->interval; |
1254 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now)); |
1262 | assert (("ev_periodic timeout in the past detected while processing timers, negative interval?", ((WT)w)->at > ev_rt_now)); |
1255 | downheap ((WT *)periodics, periodiccnt, 0); |
1263 | downheap (periodics, periodiccnt, 0); |
1256 | } |
1264 | } |
1257 | else |
1265 | else |
1258 | ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1266 | ev_periodic_stop (EV_A_ w); /* nonrepeating: stop timer */ |
1259 | |
1267 | |
1260 | ev_feed_event (EV_A_ (W)w, EV_PERIODIC); |
1268 | ev_feed_event (EV_A_ (W)w, EV_PERIODIC); |
… | |
… | |
1267 | int i; |
1275 | int i; |
1268 | |
1276 | |
1269 | /* adjust periodics after time jump */ |
1277 | /* adjust periodics after time jump */ |
1270 | for (i = 0; i < periodiccnt; ++i) |
1278 | for (i = 0; i < periodiccnt; ++i) |
1271 | { |
1279 | { |
1272 | ev_periodic *w = periodics [i]; |
1280 | ev_periodic *w = (ev_periodic *)periodics [i]; |
1273 | |
1281 | |
1274 | if (w->reschedule_cb) |
1282 | if (w->reschedule_cb) |
1275 | ((WT)w)->at = w->reschedule_cb (w, ev_rt_now); |
1283 | ((WT)w)->at = w->reschedule_cb (w, ev_rt_now); |
1276 | else if (w->interval) |
1284 | else if (w->interval) |
1277 | ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; |
1285 | ((WT)w)->at = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; |
1278 | } |
1286 | } |
1279 | |
1287 | |
1280 | /* now rebuild the heap */ |
1288 | /* now rebuild the heap */ |
1281 | for (i = periodiccnt >> 1; i--; ) |
1289 | for (i = periodiccnt >> 1; i--; ) |
1282 | downheap ((WT *)periodics, periodiccnt, i); |
1290 | downheap (periodics, periodiccnt, i); |
1283 | } |
1291 | } |
1284 | #endif |
1292 | #endif |
1285 | |
1293 | |
1286 | #if EV_IDLE_ENABLE |
1294 | #if EV_IDLE_ENABLE |
1287 | void inline_size |
1295 | void inline_size |
… | |
… | |
1304 | } |
1312 | } |
1305 | } |
1313 | } |
1306 | } |
1314 | } |
1307 | #endif |
1315 | #endif |
1308 | |
1316 | |
1309 | int inline_size |
1317 | void inline_speed |
1310 | time_update_monotonic (EV_P) |
1318 | time_update (EV_P_ ev_tstamp max_block) |
1311 | { |
1319 | { |
|
|
1320 | int i; |
|
|
1321 | |
|
|
1322 | #if EV_USE_MONOTONIC |
|
|
1323 | if (expect_true (have_monotonic)) |
|
|
1324 | { |
|
|
1325 | ev_tstamp odiff = rtmn_diff; |
|
|
1326 | |
1312 | mn_now = get_clock (); |
1327 | mn_now = get_clock (); |
1313 | |
1328 | |
|
|
1329 | /* only fetch the realtime clock every 0.5*MIN_TIMEJUMP seconds */ |
|
|
1330 | /* interpolate in the meantime */ |
1314 | if (expect_true (mn_now - now_floor < MIN_TIMEJUMP * .5)) |
1331 | if (expect_true (mn_now - now_floor < MIN_TIMEJUMP * .5)) |
1315 | { |
1332 | { |
1316 | ev_rt_now = rtmn_diff + mn_now; |
1333 | ev_rt_now = rtmn_diff + mn_now; |
1317 | return 0; |
1334 | return; |
1318 | } |
1335 | } |
1319 | else |
1336 | |
1320 | { |
|
|
1321 | now_floor = mn_now; |
1337 | now_floor = mn_now; |
1322 | ev_rt_now = ev_time (); |
1338 | ev_rt_now = ev_time (); |
1323 | return 1; |
|
|
1324 | } |
|
|
1325 | } |
|
|
1326 | |
1339 | |
1327 | void inline_size |
1340 | /* loop a few times, before making important decisions. |
1328 | time_update (EV_P) |
1341 | * on the choice of "4": one iteration isn't enough, |
1329 | { |
1342 | * in case we get preempted during the calls to |
1330 | int i; |
1343 | * ev_time and get_clock. a second call is almost guaranteed |
1331 | |
1344 | * to succeed in that case, though. and looping a few more times |
1332 | #if EV_USE_MONOTONIC |
1345 | * doesn't hurt either as we only do this on time-jumps or |
1333 | if (expect_true (have_monotonic)) |
1346 | * in the unlikely event of having been preempted here. |
1334 | { |
1347 | */ |
1335 | if (time_update_monotonic (EV_A)) |
1348 | for (i = 4; --i; ) |
1336 | { |
1349 | { |
1337 | ev_tstamp odiff = rtmn_diff; |
|
|
1338 | |
|
|
1339 | /* loop a few times, before making important decisions. |
|
|
1340 | * on the choice of "4": one iteration isn't enough, |
|
|
1341 | * in case we get preempted during the calls to |
|
|
1342 | * ev_time and get_clock. a second call is almost guaranteed |
|
|
1343 | * to succeed in that case, though. and looping a few more times |
|
|
1344 | * doesn't hurt either as we only do this on time-jumps or |
|
|
1345 | * in the unlikely event of having been preempted here. |
|
|
1346 | */ |
|
|
1347 | for (i = 4; --i; ) |
|
|
1348 | { |
|
|
1349 | rtmn_diff = ev_rt_now - mn_now; |
1350 | rtmn_diff = ev_rt_now - mn_now; |
1350 | |
1351 | |
1351 | if (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP) |
1352 | if (fabs (odiff - rtmn_diff) < MIN_TIMEJUMP) |
1352 | return; /* all is well */ |
1353 | return; /* all is well */ |
1353 | |
1354 | |
1354 | ev_rt_now = ev_time (); |
1355 | ev_rt_now = ev_time (); |
1355 | mn_now = get_clock (); |
1356 | mn_now = get_clock (); |
1356 | now_floor = mn_now; |
1357 | now_floor = mn_now; |
1357 | } |
1358 | } |
1358 | |
1359 | |
1359 | # if EV_PERIODIC_ENABLE |
1360 | # if EV_PERIODIC_ENABLE |
1360 | periodics_reschedule (EV_A); |
1361 | periodics_reschedule (EV_A); |
1361 | # endif |
1362 | # endif |
1362 | /* no timer adjustment, as the monotonic clock doesn't jump */ |
1363 | /* no timer adjustment, as the monotonic clock doesn't jump */ |
1363 | /* timers_reschedule (EV_A_ rtmn_diff - odiff) */ |
1364 | /* timers_reschedule (EV_A_ rtmn_diff - odiff) */ |
1364 | } |
|
|
1365 | } |
1365 | } |
1366 | else |
1366 | else |
1367 | #endif |
1367 | #endif |
1368 | { |
1368 | { |
1369 | ev_rt_now = ev_time (); |
1369 | ev_rt_now = ev_time (); |
1370 | |
1370 | |
1371 | if (expect_false (mn_now > ev_rt_now || mn_now < ev_rt_now - MAX_BLOCKTIME - MIN_TIMEJUMP)) |
1371 | if (expect_false (mn_now > ev_rt_now || ev_rt_now > mn_now + max_block + MIN_TIMEJUMP)) |
1372 | { |
1372 | { |
1373 | #if EV_PERIODIC_ENABLE |
1373 | #if EV_PERIODIC_ENABLE |
1374 | periodics_reschedule (EV_A); |
1374 | periodics_reschedule (EV_A); |
1375 | #endif |
1375 | #endif |
1376 | /* adjust timers. this is easy, as the offset is the same for all of them */ |
1376 | /* adjust timers. this is easy, as the offset is the same for all of them */ |
… | |
… | |
1450 | if (expect_false (flags & EVLOOP_NONBLOCK || idleall || !activecnt)) |
1450 | if (expect_false (flags & EVLOOP_NONBLOCK || idleall || !activecnt)) |
1451 | block = 0.; /* do not block at all */ |
1451 | block = 0.; /* do not block at all */ |
1452 | else |
1452 | else |
1453 | { |
1453 | { |
1454 | /* update time to cancel out callback processing overhead */ |
1454 | /* update time to cancel out callback processing overhead */ |
1455 | #if EV_USE_MONOTONIC |
|
|
1456 | if (expect_true (have_monotonic)) |
|
|
1457 | time_update_monotonic (EV_A); |
1455 | time_update (EV_A_ 1e100); |
1458 | else |
|
|
1459 | #endif |
|
|
1460 | { |
|
|
1461 | ev_rt_now = ev_time (); |
|
|
1462 | mn_now = ev_rt_now; |
|
|
1463 | } |
|
|
1464 | |
1456 | |
1465 | block = MAX_BLOCKTIME; |
1457 | block = MAX_BLOCKTIME; |
1466 | |
1458 | |
1467 | if (timercnt) |
1459 | if (timercnt) |
1468 | { |
1460 | { |
… | |
… | |
1481 | if (expect_false (block < 0.)) block = 0.; |
1473 | if (expect_false (block < 0.)) block = 0.; |
1482 | } |
1474 | } |
1483 | |
1475 | |
1484 | ++loop_count; |
1476 | ++loop_count; |
1485 | backend_poll (EV_A_ block); |
1477 | backend_poll (EV_A_ block); |
|
|
1478 | |
|
|
1479 | /* update ev_rt_now, do magic */ |
|
|
1480 | time_update (EV_A_ block); |
1486 | } |
1481 | } |
1487 | |
|
|
1488 | /* update ev_rt_now, do magic */ |
|
|
1489 | time_update (EV_A); |
|
|
1490 | |
1482 | |
1491 | /* queue pending timers and reschedule them */ |
1483 | /* queue pending timers and reschedule them */ |
1492 | timers_reify (EV_A); /* relative timers called last */ |
1484 | timers_reify (EV_A); /* relative timers called last */ |
1493 | #if EV_PERIODIC_ENABLE |
1485 | #if EV_PERIODIC_ENABLE |
1494 | periodics_reify (EV_A); /* absolute timers called first */ |
1486 | periodics_reify (EV_A); /* absolute timers called first */ |
… | |
… | |
1636 | ((WT)w)->at += mn_now; |
1628 | ((WT)w)->at += mn_now; |
1637 | |
1629 | |
1638 | assert (("ev_timer_start called with negative timer repeat value", w->repeat >= 0.)); |
1630 | assert (("ev_timer_start called with negative timer repeat value", w->repeat >= 0.)); |
1639 | |
1631 | |
1640 | ev_start (EV_A_ (W)w, ++timercnt); |
1632 | ev_start (EV_A_ (W)w, ++timercnt); |
1641 | array_needsize (ev_timer *, timers, timermax, timercnt, EMPTY2); |
1633 | array_needsize (WT, timers, timermax, timercnt, EMPTY2); |
1642 | timers [timercnt - 1] = w; |
1634 | timers [timercnt - 1] = (WT)w; |
1643 | upheap ((WT *)timers, timercnt - 1); |
1635 | upheap (timers, timercnt - 1); |
1644 | |
1636 | |
1645 | /*assert (("internal timer heap corruption", timers [((W)w)->active - 1] == w));*/ |
1637 | /*assert (("internal timer heap corruption", timers [((W)w)->active - 1] == w));*/ |
1646 | } |
1638 | } |
1647 | |
1639 | |
1648 | void noinline |
1640 | void noinline |
… | |
… | |
1650 | { |
1642 | { |
1651 | clear_pending (EV_A_ (W)w); |
1643 | clear_pending (EV_A_ (W)w); |
1652 | if (expect_false (!ev_is_active (w))) |
1644 | if (expect_false (!ev_is_active (w))) |
1653 | return; |
1645 | return; |
1654 | |
1646 | |
1655 | assert (("internal timer heap corruption", timers [((W)w)->active - 1] == w)); |
1647 | assert (("internal timer heap corruption", timers [((W)w)->active - 1] == (WT)w)); |
1656 | |
1648 | |
1657 | { |
1649 | { |
1658 | int active = ((W)w)->active; |
1650 | int active = ((W)w)->active; |
1659 | |
1651 | |
1660 | if (expect_true (--active < --timercnt)) |
1652 | if (expect_true (--active < --timercnt)) |
1661 | { |
1653 | { |
1662 | timers [active] = timers [timercnt]; |
1654 | timers [active] = timers [timercnt]; |
1663 | adjustheap ((WT *)timers, timercnt, active); |
1655 | adjustheap (timers, timercnt, active); |
1664 | } |
1656 | } |
1665 | } |
1657 | } |
1666 | |
1658 | |
1667 | ((WT)w)->at -= mn_now; |
1659 | ((WT)w)->at -= mn_now; |
1668 | |
1660 | |
… | |
… | |
1675 | if (ev_is_active (w)) |
1667 | if (ev_is_active (w)) |
1676 | { |
1668 | { |
1677 | if (w->repeat) |
1669 | if (w->repeat) |
1678 | { |
1670 | { |
1679 | ((WT)w)->at = mn_now + w->repeat; |
1671 | ((WT)w)->at = mn_now + w->repeat; |
1680 | adjustheap ((WT *)timers, timercnt, ((W)w)->active - 1); |
1672 | adjustheap (timers, timercnt, ((W)w)->active - 1); |
1681 | } |
1673 | } |
1682 | else |
1674 | else |
1683 | ev_timer_stop (EV_A_ w); |
1675 | ev_timer_stop (EV_A_ w); |
1684 | } |
1676 | } |
1685 | else if (w->repeat) |
1677 | else if (w->repeat) |
… | |
… | |
1706 | } |
1698 | } |
1707 | else |
1699 | else |
1708 | ((WT)w)->at = w->offset; |
1700 | ((WT)w)->at = w->offset; |
1709 | |
1701 | |
1710 | ev_start (EV_A_ (W)w, ++periodiccnt); |
1702 | ev_start (EV_A_ (W)w, ++periodiccnt); |
1711 | array_needsize (ev_periodic *, periodics, periodicmax, periodiccnt, EMPTY2); |
1703 | array_needsize (WT, periodics, periodicmax, periodiccnt, EMPTY2); |
1712 | periodics [periodiccnt - 1] = w; |
1704 | periodics [periodiccnt - 1] = (WT)w; |
1713 | upheap ((WT *)periodics, periodiccnt - 1); |
1705 | upheap (periodics, periodiccnt - 1); |
1714 | |
1706 | |
1715 | /*assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == w));*/ |
1707 | /*assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == w));*/ |
1716 | } |
1708 | } |
1717 | |
1709 | |
1718 | void noinline |
1710 | void noinline |
… | |
… | |
1720 | { |
1712 | { |
1721 | clear_pending (EV_A_ (W)w); |
1713 | clear_pending (EV_A_ (W)w); |
1722 | if (expect_false (!ev_is_active (w))) |
1714 | if (expect_false (!ev_is_active (w))) |
1723 | return; |
1715 | return; |
1724 | |
1716 | |
1725 | assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == w)); |
1717 | assert (("internal periodic heap corruption", periodics [((W)w)->active - 1] == (WT)w)); |
1726 | |
1718 | |
1727 | { |
1719 | { |
1728 | int active = ((W)w)->active; |
1720 | int active = ((W)w)->active; |
1729 | |
1721 | |
1730 | if (expect_true (--active < --periodiccnt)) |
1722 | if (expect_true (--active < --periodiccnt)) |
1731 | { |
1723 | { |
1732 | periodics [active] = periodics [periodiccnt]; |
1724 | periodics [active] = periodics [periodiccnt]; |
1733 | adjustheap ((WT *)periodics, periodiccnt, active); |
1725 | adjustheap (periodics, periodiccnt, active); |
1734 | } |
1726 | } |
1735 | } |
1727 | } |
1736 | |
1728 | |
1737 | ev_stop (EV_A_ (W)w); |
1729 | ev_stop (EV_A_ (W)w); |
1738 | } |
1730 | } |
… | |
… | |
1759 | if (expect_false (ev_is_active (w))) |
1751 | if (expect_false (ev_is_active (w))) |
1760 | return; |
1752 | return; |
1761 | |
1753 | |
1762 | assert (("ev_signal_start called with illegal signal number", w->signum > 0)); |
1754 | assert (("ev_signal_start called with illegal signal number", w->signum > 0)); |
1763 | |
1755 | |
|
|
1756 | { |
|
|
1757 | #ifndef _WIN32 |
|
|
1758 | sigset_t full, prev; |
|
|
1759 | sigfillset (&full); |
|
|
1760 | sigprocmask (SIG_SETMASK, &full, &prev); |
|
|
1761 | #endif |
|
|
1762 | |
|
|
1763 | array_needsize (ANSIG, signals, signalmax, w->signum, signals_init); |
|
|
1764 | |
|
|
1765 | #ifndef _WIN32 |
|
|
1766 | sigprocmask (SIG_SETMASK, &prev, 0); |
|
|
1767 | #endif |
|
|
1768 | } |
|
|
1769 | |
1764 | ev_start (EV_A_ (W)w, 1); |
1770 | ev_start (EV_A_ (W)w, 1); |
1765 | array_needsize (ANSIG, signals, signalmax, w->signum, signals_init); |
|
|
1766 | wlist_add ((WL *)&signals [w->signum - 1].head, (WL)w); |
1771 | wlist_add ((WL *)&signals [w->signum - 1].head, (WL)w); |
1767 | |
1772 | |
1768 | if (!((WL)w)->next) |
1773 | if (!((WL)w)->next) |
1769 | { |
1774 | { |
1770 | #if _WIN32 |
1775 | #if _WIN32 |