少年修仙传客户端基础资源
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
#include "os/c-api/il2cpp-config-platforms.h"
 
#if !IL2CPP_TINY_WITHOUT_DEBUGGER
 
#include "os/c-api/Semaphore-c-api.h"
#include "os/Semaphore.h"
 
extern "C"
{
    UnityPalSemaphore* UnityPalSemaphoreNew(int32_t manualReset, int32_t signaled)
    {
        return new il2cpp::os::Semaphore(manualReset, signaled);
    }
 
    void UnityPalSemaphoreDelete(UnityPalSemaphore* semaphore)
    {
        IL2CPP_ASSERT(semaphore);
        delete semaphore;
    }
 
    int32_t UnityPalSemaphorePost(UnityPalSemaphore* semaphore, int32_t releaseCount, int32_t* previousCount)
    {
        IL2CPP_ASSERT(semaphore);
        return semaphore->Post(releaseCount, previousCount);
    }
 
    UnityPalWaitStatus UnityPalSemaphoreWait(UnityPalSemaphore* semaphore, int32_t interruptible)
    {
        IL2CPP_ASSERT(semaphore);
        return semaphore->Wait((bool)interruptible);
    }
 
    UnityPalWaitStatus UnityPalSemaphoreWaitMs(UnityPalSemaphore* semaphore, uint32_t ms, int32_t interruptible)
    {
        IL2CPP_ASSERT(semaphore);
        return semaphore->Wait(ms, interruptible);
    }
 
    UnityPalSemaphoreHandle* UnityPalSemaphoreHandleNew(UnityPalSemaphore* semaphore)
    {
        IL2CPP_ASSERT(semaphore);
        return new UnityPalSemaphoreHandle(semaphore);
    }
 
    void UnityPalSemaphoreHandleDelete(UnityPalSemaphoreHandle* handle)
    {
        IL2CPP_ASSERT(handle);
        delete handle;
    }
 
    int32_t UnityPalSemaphoreHandleWait(UnityPalSemaphoreHandle* handle)
    {
        IL2CPP_ASSERT(handle);
        return handle->Wait();
    }
 
    int32_t UnityPalSemaphoreHandleWaitMs(UnityPalSemaphoreHandle* handle, uint32_t ms)
    {
        IL2CPP_ASSERT(handle);
        return handle->Wait(ms);
    }
 
    void UnityPalSemaphoreHandleSignal(UnityPalSemaphoreHandle* handle)
    {
        IL2CPP_ASSERT(handle);
        handle->Signal();
    }
 
    UnityPalSemaphore* UnityPalSemaphoreHandleGet(UnityPalSemaphoreHandle* handle)
    {
        IL2CPP_ASSERT(handle);
        return &handle->Get();
    }
}
 
#endif