ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.71 by root, Tue Oct 24 16:35:04 2006 UTC vs.
Revision 1.72 by root, Tue Oct 24 17:22:17 2006 UTC

240 abort (); 240 abort ();
241} 241}
242 242
243static void req_invoke (aio_req req); 243static void req_invoke (aio_req req);
244static void req_free (aio_req req); 244static void req_free (aio_req req);
245static void req_cancel (aio_req req);
245 246
246/* must be called at most once */ 247/* must be called at most once */
247static SV *req_sv (aio_req req, const char *klass) 248static SV *req_sv (aio_req req, const char *klass)
248{ 249{
249 if (!req->self) 250 if (!req->self)
468 free (req->data2ptr); 469 free (req->data2ptr);
469 470
470 Safefree (req); 471 Safefree (req);
471} 472}
472 473
474static void req_cancel_subs (aio_req grp)
475{
476 aio_req sub;
477
478 if (grp->type != REQ_GROUP)
479 return;
480
481 SvREFCNT_dec (grp->fh2);
482 grp->fh2 = 0;
483
484 for (sub = grp->grp_first; sub; sub = sub->grp_next)
485 req_cancel (sub);
486}
487
473static void req_cancel (aio_req req) 488static void req_cancel (aio_req req)
474{ 489{
475 req->flags |= FLAG_CANCELLED; 490 req->flags |= FLAG_CANCELLED;
476 491
477 if (req->type == REQ_GROUP) 492 req_cancel_subs (req);
478 {
479 aio_req sub;
480
481 for (sub = req->grp_first; sub; sub = sub->grp_next)
482 req_cancel (sub);
483 }
484} 493}
485 494
486static int poll_cb () 495static int poll_cb ()
487{ 496{
488 dSP; 497 dSP;
1495 } 1504 }
1496 } 1505 }
1497} 1506}
1498 1507
1499void 1508void
1509cancel_subs (aio_req_ornot req)
1510 CODE:
1511 req_cancel_subs (req);
1512
1513void
1500result (aio_req grp, ...) 1514result (aio_req grp, ...)
1501 CODE: 1515 CODE:
1502{ 1516{
1503 int i; 1517 int i;
1504 AV *av = newAV (); 1518 AV *av = newAV ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines