summaryrefslogtreecommitdiff
path: root/XSlock.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-07-21 05:46:59 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-07-21 05:46:59 +0000
commit6de196ee48b72f30391cfba66f39b3056b7ed095 (patch)
tree86e5facbbda464d921034674e58d5bfcde93ca45 /XSlock.h
parent9f53fe7d93eb5e037ad4e2dad8fdfda2936aa875 (diff)
downloadperl-6de196ee48b72f30391cfba66f39b3056b7ed095.tar.gz
change case of PERL_OBJECT filenames, consistent with the rest
p4raw-id: //depot/perl@1609
Diffstat (limited to 'XSlock.h')
-rw-r--r--XSlock.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/XSlock.h b/XSlock.h
new file mode 100644
index 0000000000..8fb0ce4789
--- /dev/null
+++ b/XSlock.h
@@ -0,0 +1,35 @@
+#ifndef __XSlock_h__
+#define __XSlock_h__
+
+class XSLockManager
+{
+public:
+ XSLockManager() { InitializeCriticalSection(&cs); };
+ ~XSLockManager() { DeleteCriticalSection(&cs); };
+ void Enter(void) { EnterCriticalSection(&cs); };
+ void Leave(void) { LeaveCriticalSection(&cs); };
+protected:
+ CRITICAL_SECTION cs;
+};
+
+XSLockManager g_XSLock;
+
+class XSLock
+{
+public:
+ XSLock() { g_XSLock.Enter(); };
+ ~XSLock() { g_XSLock.Leave(); };
+};
+
+CPerlObj* pPerl;
+
+#undef dXSARGS
+#define dXSARGS \
+ dSP; dMARK; \
+ I32 ax = mark - PL_stack_base + 1; \
+ I32 items = sp - mark; \
+ XSLock localLock; \
+ ::pPerl = pPerl
+
+
+#endif