MCPcopy Create free account
hub / github.com/axhlzy/Il2CppHookScripts / scheduleOnInitializerThread

Method scheduleOnInitializerThread

Il2cppHook/_Ufunc.js:10652–10663  ·  view source on GitHub ↗

Schedules a callback on the Il2Cpp initializer thread.

(block)

Source from the content-addressed store, hash-verified

10650 }
10651 /** Schedules a callback on the Il2Cpp initializer thread. */
10652 static scheduleOnInitializerThread(block) {
10653 return new Promise(resolve => {
10654 const listener = Interceptor.attach(Il2Cpp.Api._threadCurrent, () => {
10655 const currentThreadId = Il2Cpp.currentThread?.id;
10656 if (currentThreadId != undefined && currentThreadId == Il2Cpp.attachedThreads[0].id) {
10657 listener.detach();
10658 const result = block();
10659 setImmediate(() => resolve(result));
10660 }
10661 });
10662 });
10663 }
10664 /** Attaches the caller thread to Il2Cpp domain and executes the given block. */
10665 static async perform(block) {
10666 await this.initialize();

Callers

nothing calls this directly

Calls 2

detachMethod · 0.80
attachMethod · 0.45

Tested by

no test coverage detected