From: Gurusamy Sarathy Date: Thu, 24 Jun 1999 22:41:17 +0000 (+0000) Subject: avoid race condition in the CAPI extension bootstrap handler X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74a2feed3f7ab8f6e9b1144cca2f3eb4f6fd9498;p=p5sagit%2Fp5-mst-13.2.git avoid race condition in the CAPI extension bootstrap handler p4raw-id: //depot/perl@3549 --- diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index 416c1d5..83ad03a 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -1327,8 +1327,7 @@ print Q<<"EOF"; ##endif #XSCAPI(boot_$Module_cname) #[[ -# SetCPerlObj(pPerl); -# boot__CAPI_entry(cv); +# boot_CAPI_handler(cv, boot__CAPI_entry, pPerl); #]] ##endif /* PERL_CAPI */ EOF diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl index 60d199d..63688af 100644 --- a/win32/GenCAPI.pl +++ b/win32/GenCAPI.pl @@ -527,6 +527,7 @@ readvars %globvar, '..\perlvars.h','G'; open(HDRFILE, ">$hdrfile") or die "$0: Can't open $hdrfile: $!\n"; print HDRFILE <Perl_get_opargs(); } +void boot_CAPI_handler(CV *cv, void (*subaddr)(CV *c), void *pP) +{ +#ifndef NO_XSLOCKS + XSLock localLock((CPerlObj*)pP); +#endif + subaddr(cv); +} + void xs_handler(CV* cv, CPerlObj* p) { void(*func)(CV*);