… | |
… | |
1417 | ev_io_start (EV_A_ &pipe_w); |
1417 | ev_io_start (EV_A_ &pipe_w); |
1418 | ev_unref (EV_A); /* watcher should not keep loop alive */ |
1418 | ev_unref (EV_A); /* watcher should not keep loop alive */ |
1419 | } |
1419 | } |
1420 | } |
1420 | } |
1421 | |
1421 | |
1422 | inline_size void |
1422 | inline_speed void |
1423 | evpipe_write (EV_P_ EV_ATOMIC_T *flag) |
1423 | evpipe_write (EV_P_ EV_ATOMIC_T *flag) |
1424 | { |
1424 | { |
1425 | if (!*flag) |
1425 | if (!*flag) |
1426 | { |
1426 | { |
1427 | *flag = 1; |
1427 | *flag = 1; |
1428 | |
1428 | |
1429 | pipe_write_skipped = 1; |
1429 | pipe_write_skipped = 1; |
1430 | |
1430 | |
1431 | if (pipe_write_wanted) |
1431 | if (pipe_write_wanted) |
1432 | { |
1432 | { |
1433 | int old_errno = errno; /* save errno because write will clobber it */ |
1433 | int old_errno; |
1434 | char dummy; |
|
|
1435 | |
1434 | |
1436 | pipe_write_skipped = 0; |
1435 | pipe_write_skipped = 0; |
|
|
1436 | |
|
|
1437 | old_errno = errno; /* save errno because write will clobber it */ |
1437 | |
1438 | |
1438 | #if EV_USE_EVENTFD |
1439 | #if EV_USE_EVENTFD |
1439 | if (evfd >= 0) |
1440 | if (evfd >= 0) |
1440 | { |
1441 | { |
1441 | uint64_t counter = 1; |
1442 | uint64_t counter = 1; |
… | |
… | |
1447 | /* win32 people keep sending patches that change this write() to send() */ |
1448 | /* win32 people keep sending patches that change this write() to send() */ |
1448 | /* and then run away. but send() is wrong, it wants a socket handle on win32 */ |
1449 | /* and then run away. but send() is wrong, it wants a socket handle on win32 */ |
1449 | /* so when you think this write should be a send instead, please find out */ |
1450 | /* so when you think this write should be a send instead, please find out */ |
1450 | /* where your send() is from - it's definitely not the microsoft send, and */ |
1451 | /* where your send() is from - it's definitely not the microsoft send, and */ |
1451 | /* tell me. thank you. */ |
1452 | /* tell me. thank you. */ |
1452 | write (evpipe [1], &dummy, 1); |
1453 | write (evpipe [1], &(evpipe [1]), 1); |
1453 | } |
1454 | } |
1454 | |
1455 | |
1455 | errno = old_errno; |
1456 | errno = old_errno; |
1456 | } |
1457 | } |
1457 | } |
1458 | } |