--- IO-AIO/AIO.xs 2006/06/24 16:27:02 1.40 +++ IO-AIO/AIO.xs 2006/07/21 07:35:31 1.42 @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -784,6 +785,11 @@ BOOT: { + HV *stash = gv_stashpv ("IO::AIO", 1); + newCONSTSUB (stash, "EXDEV", newSViv (EXDEV)); + newCONSTSUB (stash, "O_RDONLY", newSViv (O_RDONLY)); + newCONSTSUB (stash, "O_WRONLY", newSViv (O_WRONLY)); + create_pipe (); pthread_atfork (atfork_prepare, atfork_parent, atfork_child); } @@ -1028,6 +1034,29 @@ send_req (req); } +#if 0 + +# undocumented, because it does not cancel active requests +void +cancel_most_requests () + PROTOTYPE: + CODE: +{ + aio_req *req; + + pthread_mutex_lock (&reqlock); + for (req = reqs; req; req = req->next) + req->flags |= 1; + pthread_mutex_unlock (&reqlock); + + pthread_mutex_lock (&reslock); + for (req = ress; req; req = req->next) + req->flags |= 1; + pthread_mutex_unlock (&reslock); +} + +#endif + void flush () PROTOTYPE: