mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 12:04:45 +00:00
Attempt to fix Linux
This commit is contained in:
parent
d0f427721c
commit
ecf2dbbb37
2 changed files with 10 additions and 4 deletions
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
Thread::Thread() : native_handle{nullptr} {}
|
||||
Thread::Thread() : native_handle{0} {}
|
||||
|
||||
Thread::~Thread() {}
|
||||
|
||||
|
@ -20,7 +20,7 @@ int Thread::Create(ThreadFunc func, void* arg) {
|
|||
native_handle = CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)func, arg, 0, nullptr);
|
||||
return native_handle ? 0 : -1;
|
||||
#else
|
||||
pthread_t* pthr = reinterpret_cast<pthread_t*>(native_handle);
|
||||
pthread_t* pthr = reinterpret_cast<pthread_t*>(&native_handle);
|
||||
pthread_attr_t pattr;
|
||||
pthread_attr_init(&pattr);
|
||||
return pthread_create(pthr, &pattr, (PthreadFunc)func, arg);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Core {
|
||||
|
||||
class Thread {
|
||||
|
@ -16,12 +18,16 @@ public:
|
|||
int Create(ThreadFunc func, void* arg);
|
||||
void Exit();
|
||||
|
||||
void* GetHandle() {
|
||||
return native_handle;
|
||||
uintptr_t GetHandle() {
|
||||
return reinterpret_cast<uintptr_t>(native_handle);
|
||||
}
|
||||
|
||||
private:
|
||||
#if _WIN64
|
||||
void* native_handle;
|
||||
#else
|
||||
uintptr_t native_handle;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace Core
|
Loading…
Add table
Reference in a new issue