summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-03-28 07:26:33 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-03-28 07:26:33 +0000
commit0dad278e2a625244694649cfac987b3d6d60729e (patch)
treeb724a3708a765bebd97234debd633ff2ff4ffa56
parent06aa0007b04a55d3a6770f95c236df8fa277ec32 (diff)
downloadperl-0dad278e2a625244694649cfac987b3d6d60729e.tar.gz
ensure XS_LOCKS stuff happens *before* XSUB is entered under
-DPERL_CAPI p4raw-id: //depot/maint-5.005/perl@3186
-rw-r--r--XSlock.h21
-rw-r--r--win32/GenCAPI.pl3
-rw-r--r--win32/Makefile2
-rw-r--r--win32/makefile.mk2
4 files changed, 17 insertions, 11 deletions
diff --git a/XSlock.h b/XSlock.h
index 8fb0ce4789..0b2c8299b9 100644
--- a/XSlock.h
+++ b/XSlock.h
@@ -13,23 +13,26 @@ protected:
};
XSLockManager g_XSLock;
+CPerlObj* pPerl;
class XSLock
{
public:
- XSLock() { g_XSLock.Enter(); };
+ XSLock(CPerlObj *p) {
+ g_XSLock.Enter();
+ ::pPerl = p;
+ };
~XSLock() { g_XSLock.Leave(); };
};
-CPerlObj* pPerl;
-
+/* PERL_CAPI does its own locking in xs_handler() */
+#if defined(PERL_OBJECT) && !defined(PERL_CAPI)
#undef dXSARGS
#define dXSARGS \
- dSP; dMARK; \
- I32 ax = mark - PL_stack_base + 1; \
- I32 items = sp - mark; \
- XSLock localLock; \
- ::pPerl = pPerl
-
+ XSLock localLock(pPerl); \
+ dSP; dMARK; \
+ I32 ax = mark - PL_stack_base + 1; \
+ I32 items = sp - mark
+#endif /* PERL_OBJECT && !PERL_CAPI */
#endif
diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl
index 2ec2809c3b..e1633e9135 100644
--- a/win32/GenCAPI.pl
+++ b/win32/GenCAPI.pl
@@ -595,6 +595,9 @@ U32 * _Perl_opargs(void)
void xs_handler(CV* cv, CPerlObj* p)
{
+#ifndef NO_XSLOCKS
+ XSLock localLock(p);
+#endif
void(*func)(CV*);
SV* sv;
MAGIC* m = pPerl->Perl_mg_find((SV*)cv, '~');
diff --git a/win32/Makefile b/win32/Makefile
index cc6c6de512..fb91efb4b5 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -952,7 +952,7 @@ clean :
-@erase $(WIN32_OBJ)
-@erase $(DLL_OBJ)
-@erase $(X2P_OBJ)
- -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp
+ -@erase ..\*$(o) ..\*.lib ..\*.exp ..\*.res *$(o) *.lib *.exp *.res
-@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
-@erase ..\x2p\*.exe ..\x2p\*.bat
-@erase *.ilk
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 1287433749..244b2c976b 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -1114,7 +1114,7 @@ clean :
-@erase $(WIN32_OBJ)
-@erase $(DLL_OBJ)
-@erase $(X2P_OBJ)
- -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp
+ -@erase ..\*$(o) ..\*$(a) ..\*.exp ..\*.res *$(o) *$(a) *.exp *.res
-@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
-@erase ..\x2p\*.exe ..\x2p\*.bat
-@erase *.ilk