Mercurial > projects > hoofbaby
comparison deps/Platinum/ThirdParty/Neptune/Source/System/Win32/NptWin32Threads.h @ 0:3425707ddbf6
Initial import (hopefully this mercurial stuff works...)
author | fraserofthenight |
---|---|
date | Mon, 06 Jul 2009 08:06:28 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3425707ddbf6 |
---|---|
1 /***************************************************************** | |
2 | | |
3 | Neptune - Threads :: Win32 Implementation | |
4 | | |
5 | (c) 2001-2003 Gilles Boccon-Gibod | |
6 | Author: Gilles Boccon-Gibod (bok@bok.net) | |
7 | | |
8 ****************************************************************/ | |
9 | |
10 /*---------------------------------------------------------------------- | |
11 | includes | |
12 +---------------------------------------------------------------------*/ | |
13 #include "NptConfig.h" | |
14 #include "NptTypes.h" | |
15 #include "NptThreads.h" | |
16 #include "NptDebug.h" | |
17 | |
18 /*---------------------------------------------------------------------- | |
19 | NPT_Win32Mutex | |
20 +---------------------------------------------------------------------*/ | |
21 class NPT_Win32Mutex : public NPT_MutexInterface | |
22 { | |
23 public: | |
24 // methods | |
25 NPT_Win32Mutex(); | |
26 virtual ~NPT_Win32Mutex(); | |
27 | |
28 // NPT_Mutex methods | |
29 virtual NPT_Result Lock(); | |
30 virtual NPT_Result Unlock(); | |
31 | |
32 private: | |
33 // members | |
34 HANDLE m_Handle; | |
35 }; | |
36 | |
37 /*---------------------------------------------------------------------- | |
38 | NPT_Win32Event | |
39 +---------------------------------------------------------------------*/ | |
40 class NPT_Win32Event | |
41 { | |
42 public: | |
43 // methods | |
44 NPT_Win32Event(bool manual = false, bool initial = false); | |
45 virtual ~NPT_Win32Event(); | |
46 | |
47 virtual NPT_Result Wait(NPT_Timeout timeout = NPT_TIMEOUT_INFINITE); | |
48 virtual void Signal(); | |
49 virtual void Reset(); | |
50 | |
51 private: | |
52 // members | |
53 HANDLE m_Event; | |
54 }; | |
55 | |
56 /*---------------------------------------------------------------------- | |
57 | NPT_Win32CriticalSection | |
58 +---------------------------------------------------------------------*/ | |
59 class NPT_Win32CriticalSection | |
60 { | |
61 public: | |
62 // methods | |
63 NPT_Win32CriticalSection(); | |
64 ~NPT_Win32CriticalSection(); | |
65 | |
66 // NPT_Mutex methods | |
67 NPT_Result Lock(); | |
68 NPT_Result Unlock(); | |
69 | |
70 private: | |
71 // members | |
72 CRITICAL_SECTION m_CriticalSection; | |
73 }; |