少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#include "os/c-api/il2cpp-config-platforms.h"
#include "os/Mutex.h"
 
#if IL2CPP_SUPPORT_THREADS
 
#include "os/Atomic.h"
#if IL2CPP_THREADS_WIN32
#include "os/Win32/MutexImpl.h"
#elif IL2CPP_TARGET_PSP2
#include "os/PSP2/MutexImpl.h"
#elif IL2CPP_THREADS_PTHREAD
#include "os/Posix/MutexImpl.h"
#else
#include "os/MutexImpl.h"
#endif
 
namespace il2cpp
{
namespace os
{
    Mutex::Mutex(bool initiallyOwned)
        : m_Mutex(new MutexImpl())
    {
        if (initiallyOwned)
            Lock();
    }
 
    Mutex::~Mutex()
    {
        delete m_Mutex;
    }
 
    void Mutex::Lock(bool interruptible)
    {
        m_Mutex->Lock(interruptible);
    }
 
    bool Mutex::TryLock(uint32_t milliseconds, bool interruptible)
    {
        return m_Mutex->TryLock(milliseconds, interruptible);
    }
 
    void Mutex::Unlock()
    {
        m_Mutex->Unlock();
    }
 
    void* Mutex::GetOSHandle()
    {
        return m_Mutex->GetOSHandle();
    }
 
    FastMutex::FastMutex()
        : m_Impl(new FastMutexImpl())
    {
    }
 
    FastMutex::~FastMutex()
    {
        delete m_Impl;
    }
 
    void FastMutex::Lock()
    {
        m_Impl->Lock();
    }
 
    void FastMutex::Unlock()
    {
        m_Impl->Unlock();
    }
 
    FastMutexImpl* FastMutex::GetImpl()
    {
        return m_Impl;
    }
}
}
 
#else
 
namespace il2cpp
{
namespace os
{
    Mutex::Mutex(bool initiallyOwned)
    {
    }
 
    Mutex::~Mutex()
    {
    }
 
    void Mutex::Lock(bool interruptible)
    {
    }
 
    bool Mutex::TryLock(uint32_t milliseconds, bool interruptible)
    {
        return true;
    }
 
    void Mutex::Unlock()
    {
    }
 
    void* Mutex::GetOSHandle()
    {
        return NULL;
    }
 
    FastMutex::FastMutex()
    {
    }
 
    FastMutex::~FastMutex()
    {
    }
 
    void FastMutex::Lock()
    {
    }
 
    void FastMutex::Unlock()
    {
    }
 
    FastMutexImpl* FastMutex::GetImpl()
    {
        IL2CPP_ASSERT(0 && "Threads are not enabled for this platform.");
        return NULL;
    }
}
}
 
#endif