Commit | Line | Data |
6de196ee |
1 | #ifndef __XSlock_h__ |
2 | #define __XSlock_h__ |
565764a8 |
3 | |
4 | class XSLockManager |
5 | { |
6 | public: |
7 | XSLockManager() { InitializeCriticalSection(&cs); }; |
8 | ~XSLockManager() { DeleteCriticalSection(&cs); }; |
9 | void Enter(void) { EnterCriticalSection(&cs); }; |
10 | void Leave(void) { LeaveCriticalSection(&cs); }; |
11 | protected: |
12 | CRITICAL_SECTION cs; |
13 | }; |
14 | |
15 | XSLockManager g_XSLock; |
16 | |
17 | class XSLock |
18 | { |
19 | public: |
20 | XSLock() { g_XSLock.Enter(); }; |
21 | ~XSLock() { g_XSLock.Leave(); }; |
22 | }; |
23 | |
24 | CPerlObj* 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 |