Got it working on Windows using Mingw

This commit is contained in:
2024-12-29 21:44:33 -06:00
parent 5b89d8c5de
commit f1bae988c4
15 changed files with 139 additions and 33 deletions

View File

@ -1,6 +1,8 @@
#pragma once
#include <functional>
#if defined(GEKKO)
#if defined(_WIN32)
#include <windows.h>
#elif defined(GEKKO)
#include <ogc/lwp.h>
#else
#include <threads.h>
@ -10,8 +12,13 @@ namespace Tesses::Framework::Threading
{
class Thread
{
std::atomic<bool> hasInvoked;
#if defined(GEKKO)
#if defined(_WIN32)
HANDLE thrd;
DWORD thrdId;
public:
#elif defined(GEKKO)
lwp_t thrd;
static void* cb(void* ptr);
#else
@ -19,6 +26,8 @@ namespace Tesses::Framework::Threading
static int cb(void* ptr);
#endif
std::function<void()> fn;
std::atomic<bool> hasInvoked;
public:
Thread(std::function<void()> fn);
void Join();