--- IO-AIO/AIO.xs 2006/10/23 18:38:15 1.57 +++ IO-AIO/AIO.xs 2006/10/23 18:48:08 1.58 @@ -85,9 +85,14 @@ int errorno; STRLEN dataoffset; mode_t mode; /* open */ - unsigned char cancelled; + unsigned char pri; + unsigned char flags; } aio_cb; +enum { + FLAG_CANCELLED = 0x01, +}; + typedef aio_cb *aio_req; typedef aio_cb *aio_req_ornot; @@ -132,7 +137,7 @@ static void aio_grp_feed (aio_req grp) { - while (grp->length < grp->fd2 && !grp->cancelled) + while (grp->length < grp->fd2 && !(grp->flags & FLAG_CANCELLED)) { int old_len = grp->length; @@ -193,7 +198,7 @@ dSP; int errorno = errno; - if (req->cancelled || !SvOK (req->callback)) + if (req->flags & FLAG_CANCELLED || !SvOK (req->callback)) return; errno = req->errorno; @@ -323,7 +328,7 @@ static void req_cancel (aio_req req) { - req->cancelled = 1; + req->flags |= FLAG_CANCELLED; if (req->type == REQ_GROUP) { @@ -788,7 +793,7 @@ errno = 0; /* strictly unnecessary */ - if (!req->cancelled) + if (!(req->flags & FLAG_CANCELLED)) switch (type = req->type) /* remember type for QUIT check */ { case REQ_READ: req->result = pread (req->fd, req->dataptr, req->length, req->offset); break;