少年修仙传客户端基础资源
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
#include "w32semaphore.h"
#include "Semaphore-c-api.h"
#include "Error-c-api.h"
 
void
mono_w32semaphore_init (void)
{
}
 
gpointer
ves_icall_System_Threading_Semaphore_CreateSemaphore_internal (gint32 initialCount, gint32 maximumCount, MonoString *name, gint32 *error)
{
    if (name != NULL)
    {
        g_assertion_message("Named semaphores are not supported by the Unity platform.");
        return NULL;
    }
 
    UnityPalSemaphore* semaphore = UnityPalSemaphoreNew(initialCount, maximumCount);
    *error = UnityPalGetLastError();
    return UnityPalSemaphoreHandleNew(semaphore);
}
 
MonoBoolean
ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal (gpointer handle, gint32 releaseCount, gint32 *prevcount)
{
    return UnityPalSemaphorePost(UnityPalSemaphoreHandleGet(handle), releaseCount, prevcount);
}
 
gpointer
ves_icall_System_Threading_Semaphore_OpenSemaphore_internal (MonoString *name, gint32 rights, gint32 *error)
{
    g_assertion_message("Named semaphores are not supported by the Unity platform.");
    return NULL;
}
 
MonoW32HandleNamespace*
mono_w32semaphore_get_namespace (MonoW32HandleNamedSemaphore *semaphore)
{
    g_assertion_message("Named semaphores are not supported by the Unity platform.");
    return NULL;
}