do_sv_dump does dump (core) on IO handles
[p5sagit/p5-mst-13.2.git] / XSlock.h
CommitLineData
6de196ee 1#ifndef __XSlock_h__
2#define __XSlock_h__
565764a8 3
4class XSLockManager
5{
6public:
7 XSLockManager() { InitializeCriticalSection(&cs); };
8 ~XSLockManager() { DeleteCriticalSection(&cs); };
9 void Enter(void) { EnterCriticalSection(&cs); };
10 void Leave(void) { LeaveCriticalSection(&cs); };
11protected:
12 CRITICAL_SECTION cs;
13};
14
15XSLockManager g_XSLock;
16
17class XSLock
18{
19public:
20 XSLock() { g_XSLock.Enter(); };
21 ~XSLock() { g_XSLock.Leave(); };
22};
23
24CPerlObj* pPerl;
25
26#undef dXSARGS
27#define dXSARGS \
28 dSP; dMARK; \
6b88bc9c 29 I32 ax = mark - PL_stack_base + 1; \
565764a8 30 I32 items = sp - mark; \
31 XSLock localLock; \
32 ::pPerl = pPerl
33
34
35#endif