The way to Unity, pt.1 (#1659)

This commit is contained in:
Daniel R. 2024-12-05 17:21:35 +01:00 committed by GitHub
parent 2380f2f9c9
commit 98f0cb65d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 564 additions and 29 deletions

View file

@ -11,27 +11,34 @@ struct PthreadAttr;
namespace Core {
class Thread {
public:
using ThreadFunc = void (*)(void*);
using PthreadFunc = void* (*)(void*);
using ThreadFunc = void (*)(void*);
using PthreadFunc = void* (*)(void*);
Thread();
~Thread();
class NativeThread {
public:
NativeThread();
~NativeThread();
int Create(ThreadFunc func, void* arg, const ::Libraries::Kernel::PthreadAttr* attr);
void Exit();
void Initialize();
uintptr_t GetHandle() {
return reinterpret_cast<uintptr_t>(native_handle);
}
u64 GetTid() {
return tid;
}
private:
#if _WIN64
#ifdef _WIN64
void* native_handle;
#else
uintptr_t native_handle;
#endif
u64 tid;
};
} // namespace Core