少年修仙传客户端基础资源
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
#include "il2cpp-config.h"
#include "il2cpp-object-internals.h"
#include "il2cpp-api.h"
#include "AsyncResult.h"
#include "vm/Runtime.h"
#include "vm/WaitHandle.h"
#include "vm/ThreadPoolMs.h"
#include "os/Event.h"
 
namespace il2cpp
{
namespace icalls
{
namespace mscorlib
{
namespace System
{
namespace Runtime
{
namespace Remoting
{
namespace Messaging
{
    Il2CppObject* AsyncResult::Invoke(Il2CppObject* _this)
    {
#if IL2CPP_TINY
        IL2CPP_NOT_IMPLEMENTED_ICALL(AsyncResult::Invoke);
        return NULL;
#else
        Il2CppAsyncCall *ac;
        Il2CppObject *res;
        Il2CppAsyncResult *ares = (Il2CppAsyncResult*)_this;
 
        IL2CPP_ASSERT(ares);
        IL2CPP_ASSERT(ares->async_delegate);
 
        ac = (Il2CppAsyncCall*)ares->object_data;
        if (!ac)
        {
            res = vm::Runtime::DelegateInvoke(ares->async_delegate, (void**)&ares->async_state, NULL);
        }
        else
        {
            il2cpp::os::EventHandle *wait_event = NULL;
 
            IL2CPP_OBJECT_SETREF(ac->msg, exc, NULL);
            res = il2cpp::vm::ThreadPoolMs::MessageInvoke((Il2CppObject*)ares->async_delegate->target, ac->msg, &ac->msg->exc, &ac->out_args);
            IL2CPP_OBJECT_SETREF(ac, res, res);
 
            il2cpp_monitor_enter((Il2CppObject*)ares);
            ares->completed = 1;
            if (ares->handle)
                wait_event = (il2cpp::os::EventHandle*)il2cpp::vm::WaitHandle::GetPlatformHandle(ares->handle);
 
            il2cpp_monitor_exit((Il2CppObject*)ares);
 
            if (wait_event != NULL)
                wait_event->Get().Set();
 
            Il2CppException* completionException = NULL;
 
            if (ac->cb_method)
                vm::Runtime::Invoke(ac->cb_method, ac->cb_target, (void**)&ares, &completionException);
 
            if (completionException != NULL)
                vm::Exception::Raise(completionException);
        }
 
        return res;
#endif
    }
} // namespace Messaging
} // namespace Remoting
} // namespace Runtime
} // namespace System
} // namespace mscorlib
} // namespace icalls
} // namespace il2cpp