summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2008-10-12 22:30:33 +0000
committerroot <root>2008-10-12 22:30:33 +0000
commite1114224e950a1549be615d893899b3cdb2a832e (patch)
treef4d374e5ae939dd5072ba864aeb275a4b13cc857
parentcb762b0efda97f04b1bae26ef6d36a1a46f6d06e (diff)
*** empty log message ***rel-3_16
-rw-r--r--Changes1
-rw-r--r--eio.c6
-rw-r--r--eio.h4
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 {