summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-08-16 23:46:57 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-08-16 23:46:57 +0000
commit7a9556019f9c4641b3caa83c80f9a1ded5afaaa8 (patch)
treee9f3c9661f5784a06945767ad1173178b3efffe5 /win32
parent453b8a1ca696e90551b7f2a34dd20d103122f58f (diff)
downloadperl-7a9556019f9c4641b3caa83c80f9a1ded5afaaa8.tar.gz
check that the number pseudo children doesn't exceed
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
Diffstat (limited to 'win32')
-rw-r--r--win32/perlhost.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h
index ea0d31d9dd..3b1d8ca282 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -1746,7 +1746,13 @@ PerlProcFork(struct IPerlProc* piPerl)
#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,