diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-21 05:46:59 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-21 05:46:59 +0000 |
commit | 6de196ee48b72f30391cfba66f39b3056b7ed095 (patch) | |
tree | 86e5facbbda464d921034674e58d5bfcde93ca45 /XSlock.h | |
parent | 9f53fe7d93eb5e037ad4e2dad8fdfda2936aa875 (diff) | |
download | perl-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.h | 35 |
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 |