mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-09-02 11:13:23 +02:00
Fixes for vmu profiler / thread
This commit is contained in:
@@ -14,11 +14,17 @@ Thread::Thread(const char* label, size_t stackSize, bool detached, RunFunction r
|
||||
}
|
||||
|
||||
Thread::~Thread() {
|
||||
if(!detached_) join();
|
||||
if(!detached_) {
|
||||
join();
|
||||
} else {
|
||||
#if !defined(DC_SH4)
|
||||
delete reinterpret_cast<std::thread*>(nativeHandle_);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
bool Thread::spawn(const char *label, size_t stackSize, bool detached, RunFunction runFunction, void* param) {
|
||||
#ifdef DC_SH4
|
||||
#if defined(DC_SH4)
|
||||
const kthread_attr_t thdAttr = {
|
||||
.create_detached = detached,
|
||||
.stack_size = stackSize,
|
||||
@@ -40,10 +46,11 @@ bool Thread::join() {
|
||||
if(!isValid() || detached_)
|
||||
return false;
|
||||
|
||||
#ifdef DC_SH4
|
||||
#if defined(DC_SH4)
|
||||
if(thd_join(reinterpret_cast<kthread_t*>(nativeHandle_), nullptr) != 0)
|
||||
return false;
|
||||
#else
|
||||
reinterpret_cast<std::thread*>(nativeHandle_)->join();
|
||||
delete reinterpret_cast<std::thread*>(nativeHandle_);
|
||||
#endif
|
||||
|
||||
|
@@ -62,7 +62,7 @@ protected:
|
||||
VmuProfiler();
|
||||
|
||||
// Main entry point and loop for the monitor thread
|
||||
virtual void run();
|
||||
void run();
|
||||
|
||||
public:
|
||||
|
||||
|
Reference in New Issue
Block a user