From e1114224e950a1549be615d893899b3cdb2a832e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 12 Oct 2008 22:30:33 +0000 Subject: *** empty log message *** --- Changes | 1 + eio.c | 6 ++++-- eio.h | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index e566dd3..8dfdf53 100644 --- a/Changes +++ b/Changes @@ -5,5 +5,6 @@ TODO: maybe add mincore support? available on at leats darwin, solaris, linux, f 1.0 - added msync, mtouch support (untested). - fixed custom support. + - use a more robust feed-add detection method. - "outbundled" from IO::AIO. diff --git a/eio.c b/eio.c index 8ea6b51..be7ac60 100644 --- a/eio.c +++ b/eio.c @@ -606,12 +606,12 @@ static void grp_try_feed (eio_req *grp) { while (grp->size < grp->int2 && !EIO_CANCELLED (grp)) { - int old_len = grp->size; + grp->flags &= ~EIO_FLAG_GROUPADD; EIO_FEED (grp); /* stop if no progress has been made */ - if (old_len == grp->size) + if (!(grp->flags & EIO_FLAG_GROUPADD)) { grp->feed = 0; break; @@ -1483,6 +1483,8 @@ void eio_grp_add (eio_req *grp, eio_req *req) { assert (("cannot add requests to IO::AIO::GRP after the group finished", grp->int1 != 2)); + grp->flags |= EIO_FLAG_GROUPADD; + ++grp->size; req->grp = grp; diff --git a/eio.h b/eio.h index 3c9eac7..47e8df7 100644 --- a/eio.h +++ b/eio.h @@ -112,10 +112,12 @@ struct eio_req eio_req *grp, *grp_prev, *grp_next, *grp_first; /* private */ }; +/* _private_ flags */ enum { EIO_FLAG_CANCELLED = 0x01, /* request was cancelled */ EIO_FLAG_PTR1_FREE = 0x02, /* need to free(ptr1) */ - EIO_FLAG_PTR2_FREE = 0x04 /* need to free(ptr2) */ + EIO_FLAG_PTR2_FREE = 0x04, /* need to free(ptr2) */ + EIO_FLAG_GROUPADD = 0x08 /* some request was added to the group */ }; enum { -- cgit v1.2.3