source:
proiecte/swift/trunk/lib/hoard-371/src/heaplayers/experimental/thinlock.h
@
176
Last change on this file since 176 was 176, checked in by , 14 years ago | |
---|---|
File size: 355 bytes |
Line | |
---|---|
1 | // -*- C++ -*- |
2 | |
3 | #ifndef _THINLOCK_H_ |
4 | #define _THINLOCK_H_ |
5 | |
6 | #include <windows.h> |
7 | |
8 | class ThinLock { |
9 | public: |
10 | |
11 | ThinLock (void) |
12 | { |
13 | InitializeCriticalSection (&crit); |
14 | } |
15 | |
16 | inline void lock (void) { |
17 | EnterCriticalSection (&crit); |
18 | } |
19 | |
20 | inline void unlock (void) { |
21 | LeaveCriticalSection (&crit); |
22 | } |
23 | |
24 | private: |
25 | CRITICAL_SECTION crit; |
26 | }; |
27 | |
28 | |
29 | #endif |
Note: See TracBrowser
for help on using the repository browser.