Files
FEX-Emu--FEX/FEXCore/Source/Utils/Threads.cpp
T
2026-08-30 22:27:05 -07:00

35 lines
1.0 KiB
C++

// SPDX-License-Identifier: MIT
#include <FEXCore/Utils/LogManager.h>
#include <FEXCore/Utils/Threads.h>
#include <FEXCore/fextl/memory.h>
#include <pthread.h>
#include <unistd.h>
namespace FEXCore::Threads {
static fextl::unique_ptr<FEXCore::Threads::Thread> CreateThread_Default(ThreadFunc Func, void* Arg, FEXCore::Threads::Flags Flags) {
ERROR_AND_DIE_FMT("Frontend didn't setup thread creation!");
}
static void CleanupAfterFork_Default() {
ERROR_AND_DIE_FMT("Frontend didn't setup thread creation!");
}
static FEXCore::Threads::Pointers Ptrs = {
.CreateThread = CreateThread_Default,
.CleanupAfterFork = CleanupAfterFork_Default,
};
fextl::unique_ptr<FEXCore::Threads::Thread> FEXCore::Threads::Thread::Create(ThreadFunc Func, void* Arg, FEXCore::Threads::Flags Flags) {
return Ptrs.CreateThread(Func, Arg, Flags);
}
void FEXCore::Threads::Thread::CleanupAfterFork() {
return Ptrs.CleanupAfterFork();
}
void FEXCore::Threads::Thread::SetInternalPointers(const Pointers& _Ptrs) {
Ptrs = _Ptrs;
}
} // namespace FEXCore::Threads