blob: e38609d0e0b5b28da6d5de01f986409b0034f7fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
/*****************************************************************
|
| Neptune - Threads :: WinRT Implementation
|
| (c) 2001-2012 Gilles Boccon-Gibod
| Author: Gilles Boccon-Gibod (bok@bok.net)
|
****************************************************************/
/*----------------------------------------------------------------------
| includes
+---------------------------------------------------------------------*/
#include "NptConfig.h"
#include "NptTypes.h"
#include "NptThreads.h"
#include "NptDebug.h"
/*----------------------------------------------------------------------
| NPT_WinRtMutex
+---------------------------------------------------------------------*/
class NPT_WinRtMutex : public NPT_MutexInterface
{
public:
// methods
NPT_WinRtMutex();
virtual ~NPT_WinRtMutex();
// NPT_Mutex methods
virtual NPT_Result Lock();
virtual NPT_Result Unlock();
private:
// members
HANDLE m_Handle;
};
/*----------------------------------------------------------------------
| NPT_WinRtEvent
+---------------------------------------------------------------------*/
class NPT_WinRtEvent
{
public:
// methods
NPT_WinRtEvent(bool manual = false, bool initial = false);
virtual ~NPT_WinRtEvent();
virtual NPT_Result Wait(NPT_Timeout timeout = NPT_TIMEOUT_INFINITE);
virtual void Signal();
virtual void Reset();
private:
// members
HANDLE m_Event;
};
/*----------------------------------------------------------------------
| NPT_WinRtCriticalSection
+---------------------------------------------------------------------*/
class NPT_WinRtCriticalSection
{
public:
// methods
NPT_WinRtCriticalSection();
~NPT_WinRtCriticalSection();
// NPT_Mutex methods
NPT_Result Lock();
NPT_Result Unlock();
private:
// members
CRITICAL_SECTION m_CriticalSection;
};
|