summaryrefslogtreecommitdiff
path: root/XSLock.h
diff options
context:
space:
mode:
authorDouglas Lankshear <doug@lankshear.net>1998-02-01 01:18:13 -0800
committerGurusamy Sarathy <gsar@cpan.org>1998-02-01 22:20:20 +0000
commit565764a853a177193a027e73655fad354d57fc10 (patch)
tree81b4f0277636b6f8214748868d0d9d7cc791d577 /XSLock.h
parent8f818fa030b966544b5cf7bdfa53e06a9c371bfe (diff)
downloadperl-565764a853a177193a027e73655fad354d57fc10.tar.gz
[asperl] added AS patch#3
Message-Id: <01BD2EF2.53433A40.dougl@ActiveState.com> To: "'Gurusamy Sarathy'" <gsar@umich.edu> Here's an additional diff against //depot/asperl The field name mg_length was changed back to mg_len The function name mg_len was change to mg_length The need for sort_mutex removed thanks to the code derived from Tom Horsley's work. -- Doug p4raw-id: //depot/asperl@451
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..652f4929f1
--- /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 - stack_base + 1; \
+ I32 items = sp - mark; \
+ XSLock localLock; \
+ ::pPerl = pPerl
+
+
+#endif