mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Library/Thread: Implement AyncFunctorThread (#846)
This commit is contained in:
parent
e9bcc135ee
commit
95f8c3dcfa
|
|
@ -286514,15 +286514,15 @@ Library/Thread/AsyncFunctorThread.o:
|
|||
- offset: 0xa2bd18
|
||||
size: 128
|
||||
label: _ZN2al30createAndStartInitializeThreadEPN4sead4HeapEiRKNS_11FunctorBaseE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa2bd98
|
||||
size: 4
|
||||
label: _ZN2al37tryWaitDoneAndDestroyInitializeThreadEPNS_16InitializeThreadE
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
- offset: 0xa2bd9c
|
||||
size: 144
|
||||
label: _ZN2al16getCurrentCoreIdEv
|
||||
status: NotDecompiled
|
||||
status: Matching
|
||||
Library/Yaml/ByamlIter.o:
|
||||
'.text':
|
||||
- offset: 0xa2be2c
|
||||
|
|
|
|||
|
|
@ -42,4 +42,23 @@ bool AsyncFunctorThread::isDone() const {
|
|||
return mIsDone;
|
||||
}
|
||||
|
||||
InitializeThread* createAndStartInitializeThread(sead::Heap* heap, s32 priority,
|
||||
const FunctorBase& functor) {
|
||||
InitializeThread* initializeThread =
|
||||
new InitializeThread("シーン初期化スレッド", functor, heap, priority, 0x100000);
|
||||
initializeThread->start();
|
||||
return initializeThread;
|
||||
}
|
||||
|
||||
bool tryWaitDoneAndDestroyInitializeThread(InitializeThread* thread) {
|
||||
return thread->tryWaitDoneAndDestroy();
|
||||
}
|
||||
|
||||
sead::CoreId getCurrentCoreId() {
|
||||
sead::CoreIdMask mask = sead::ThreadMgr::instance()->getCurrentThread()->getAffinity();
|
||||
for (u8 i = sead::CoreId::cMain; i <= sead::CoreId::cSub2; i++)
|
||||
if (mask.isOn(i))
|
||||
return i;
|
||||
return sead::CoreId::cMain;
|
||||
}
|
||||
} // namespace al
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <prim/seadSafeString.h>
|
||||
|
||||
#include "Library/Thread/FunctorV0M.h"
|
||||
#include "Project/Thread/InitializeThread.h"
|
||||
|
||||
namespace sead {
|
||||
class DelegateThread;
|
||||
|
|
@ -29,4 +30,8 @@ private:
|
|||
};
|
||||
|
||||
static_assert(sizeof(AsyncFunctorThread) == 0x20);
|
||||
|
||||
InitializeThread* createAndStartInitializeThread(sead::Heap*, s32, const FunctorBase&);
|
||||
bool tryWaitDoneAndDestroyInitializeThread(InitializeThread*);
|
||||
sead::CoreId getCurrentCoreId();
|
||||
} // namespace al
|
||||
|
|
|
|||
Loading…
Reference in a new issue