--- IO-AIO/AIO.xs 2011/07/17 04:20:04 1.188 +++ IO-AIO/AIO.xs 2011/07/18 02:02:26 1.190 @@ -32,11 +32,10 @@ #ifdef _WIN32 - #define EIO_STRUCT_DIRENT Direntry_t + // perl overrides all those nice libc functions + #undef malloc #undef free - - // perl overrides all those nice libc functions #undef open #undef read #undef write @@ -712,9 +711,13 @@ } } -static void atfork_child (void) +static void ecb_cold +reinit (void) { create_respipe (); + + if (eio_init (want_poll, done_poll) < 0) + croak ("IO::AIO: unable to initialise eio library"); } /*****************************************************************************/ @@ -922,16 +925,16 @@ newCONSTSUB (aio_stash, "PAGESIZE", newSViv (PAGESIZE)); - create_respipe (); - - if (eio_init (want_poll, done_poll) < 0) - croak ("IO::AIO: unable to initialise eio library"); - - /* atfork child called in fifo order, so before eio's handler */ - X_THREAD_ATFORK (0, 0, atfork_child); + reinit (); } void +reinit () + PROTOTYPE: + CODE: + reinit (); + +void max_poll_reqs (unsigned int nreqs) PROTOTYPE: $ CODE: