少年修仙传客户端基础资源
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
#include "os/c-api/il2cpp-config-platforms.h"
#include "os/Semaphore.h"
 
#if IL2CPP_SUPPORT_THREADS
 
#include "os/Atomic.h"
#if IL2CPP_TARGET_WINDOWS
#include "os/Win32/SemaphoreImpl.h"
#elif IL2CPP_TARGET_POSIX
#include "os/Posix/SemaphoreImpl.h"
#else
#include "os/SemaphoreImpl.h"
#endif
 
namespace il2cpp
{
namespace os
{
    Semaphore::Semaphore(int32_t initialValue, int32_t maximumValue)
        : m_Semaphore(new SemaphoreImpl(initialValue, maximumValue))
    {
    }
 
    Semaphore::~Semaphore()
    {
        delete m_Semaphore;
    }
 
    bool Semaphore::Post(int32_t releaseCount, int32_t* previousCount)
    {
        return m_Semaphore->Post(releaseCount, previousCount);
    }
 
    WaitStatus Semaphore::Wait(bool interruptible)
    {
        return m_Semaphore->Wait(interruptible);
    }
 
    WaitStatus Semaphore::Wait(uint32_t ms, bool interruptible)
    {
        return m_Semaphore->Wait(ms, interruptible);
    }
 
    void* Semaphore::GetOSHandle()
    {
        return m_Semaphore->GetOSHandle();
    }
}
}
 
#else
 
namespace il2cpp
{
namespace os
{
    Semaphore::Semaphore(int32_t initialValue, int32_t maximumValue)
    {
    }
 
    Semaphore::~Semaphore()
    {
    }
 
    bool Semaphore::Post(int32_t releaseCount, int32_t* previousCount)
    {
        return true;
    }
 
    WaitStatus Semaphore::Wait(bool interruptible)
    {
        return kWaitStatusSuccess;
    }
 
    WaitStatus Semaphore::Wait(uint32_t ms, bool interruptible)
    {
        return kWaitStatusSuccess;
    }
 
    void* Semaphore::GetOSHandle()
    {
        return NULL;
    }
}
}
 
#endif