forked from focus-creative-games/il2cpp_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReaderWriterLock.cpp
More file actions
95 lines (76 loc) · 1.49 KB
/
ReaderWriterLock.cpp
File metadata and controls
95 lines (76 loc) · 1.49 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "os/c-api/il2cpp-config-platforms.h"
#include "os/ReaderWriterLock.h"
#if IL2CPP_SUPPORT_THREADS
#if IL2CPP_THREADS_WIN32
#include "os/Win32/ReaderWriterLockImpl.h"
#elif IL2CPP_THREADS_PTHREAD
#include "os/Posix/ReaderWriterLockImpl.h"
#else
#include "os/ReaderWriterLockImpl.h"
#endif
namespace il2cpp
{
namespace os
{
ReaderWriterLock::ReaderWriterLock()
: m_Impl(new ReaderWriterLockImpl())
{
}
ReaderWriterLock::~ReaderWriterLock()
{
delete m_Impl;
}
void ReaderWriterLock::LockExclusive()
{
m_Impl->LockExclusive();
}
void ReaderWriterLock::LockShared()
{
m_Impl->LockShared();
}
void ReaderWriterLock::ReleaseExclusive()
{
m_Impl->ReleaseExclusive();
}
void ReaderWriterLock::ReleaseShared()
{
m_Impl->ReleaseShared();
}
ReaderWriterLockImpl* ReaderWriterLock::GetImpl()
{
return m_Impl;
}
}
}
#else
#include <stddef.h>
namespace il2cpp
{
namespace os
{
ReaderWriterLock::ReaderWriterLock()
{
}
ReaderWriterLock::~ReaderWriterLock()
{
}
void ReaderWriterLock::LockExclusive()
{
}
void ReaderWriterLock::LockShared()
{
}
void ReaderWriterLock::ReleaseExclusive()
{
}
void ReaderWriterLock::ReleaseShared()
{
}
ReaderWriterLockImpl* ReaderWriterLock::GetImpl()
{
IL2CPP_ASSERT(0 && "Threads are not enabled for this platform.");
return NULL;
}
}
}
#endif