38 #include <sys/eventfd.h>
53 handle->async_cb = async_cb;
69 if (cmpxchgi(&
handle->pending, 0, 1) != 0)
76 if (cmpxchgi(&
handle->pending, 1, 2) != 1)
92 for (
i = 0;
i < 997;
i++) {
97 rc = cmpxchgi(&
handle->pending, 2, 0);
134 if (
r ==
sizeof(
buf))
140 if (errno ==
EAGAIN || errno == EWOULDBLOCK)
160 if (
h->async_cb ==
NULL)
178 #if defined(__linux__)
183 fd =
loop->async_io_watcher.fd;
189 while (
r == -1 && errno ==
EINTR);
195 if (errno ==
EAGAIN || errno == EWOULDBLOCK)
206 if (
loop->async_io_watcher.fd != -1)
210 err = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
224 loop->async_wfd = pipefd[1];
231 if (
loop->async_io_watcher.fd == -1)
241 if (
loop->async_io_watcher.fd == -1)
244 if (
loop->async_wfd != -1) {
245 if (
loop->async_wfd !=
loop->async_io_watcher.fd)
247 loop->async_wfd = -1;
252 loop->async_io_watcher.fd = -1;
static mcore_handle handle
assert(limit<=UINT32_MAX/2)
#define QUEUE_DATA(ptr, type, field)
#define QUEUE_INSERT_TAIL(h, q)
void uv__io_stop(uv_loop_t *loop, uv__io_t *w, unsigned int events)
void uv__io_start(uv_loop_t *loop, uv__io_t *w, unsigned int events)
void uv__io_init(uv__io_t *w, uv__io_cb cb, int fd)
int uv__make_pipe(int fds[2], int flags)
#define ACCESS_ONCE(type, var)
int uv__async_fork(uv_loop_t *loop)
void uv__async_stop(uv_loop_t *loop)
int uv_async_init(uv_loop_t *loop, uv_async_t *handle, uv_async_cb async_cb)
static int uv__async_start(uv_loop_t *loop)
static void uv__async_io(uv_loop_t *loop, uv__io_t *w, unsigned int events)
static void uv__async_send(uv_loop_t *loop)
int uv_async_send(uv_async_t *handle)
void uv__async_close(uv_async_t *handle)
static int uv__async_spin(uv_async_t *handle)
#define uv__handle_init(loop_, h, type_)
#define uv__handle_stop(h)
#define uv__handle_start(h)
void(* uv_async_cb)(uv_async_t *handle)
static const z80_opcode fd[]
int read(izstream &zs, T *x, Items items)