mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 10:00:16 +02:00
37 lines
1.1 KiB
C++
37 lines
1.1 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, const char* ThreadName) {
|
|
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, const char* ThreadName) {
|
|
return Ptrs.CreateThread(Func, Arg, Flags, ThreadName);
|
|
}
|
|
|
|
void FEXCore::Threads::Thread::CleanupAfterFork() {
|
|
return Ptrs.CleanupAfterFork();
|
|
}
|
|
|
|
void FEXCore::Threads::Thread::SetInternalPointers(const Pointers& _Ptrs) {
|
|
Ptrs = _Ptrs;
|
|
}
|
|
} // namespace FEXCore::Threads
|