MAXIMUM_WAIT_OBJECTS, which is currently 64 (avoids overflowing
the WaitForMultipleObjects() limit that would cause wait()
to crash)
wait() and waitpid() could potentially be rewritten to use
more than one thread to do the waiting to eliminate this
limitation
p4raw-id: //depot/perl@6656
#ifdef USE_ITHREADS
DWORD id;
HANDLE handle;
- CPerlHost *h = new CPerlHost(*(CPerlHost*)w32_internal_host);
+ CPerlHost *h;
+
+ if (w32_num_pseudo_children >= MAXIMUM_WAIT_OBJECTS) {
+ errno = EAGAIN;
+ return -1;
+ }
+ h = new CPerlHost(*(CPerlHost*)w32_internal_host);
PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHXo, 1,
h->m_pHostperlMem,
h->m_pHostperlMemShared,