mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Optimizations (#1680)
* Optimizations 1) Some headers simplified for better compilation time 2) Some templates simplified for smaller executable size 3) Eliminate std::future to fix compilation for mingw64 4) PKG installation can be cancelled now 5) cellGame fixes 6) XAudio2 fix for mingw64 7) PPUInterpreter bug fixed (Clang) * any_pod<> implemented Aliases: any16, any32, any64 rsx::make_command fixed
This commit is contained in:
parent
75fe95eeb1
commit
da7472fe81
96 changed files with 2086 additions and 1772 deletions
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "Emu/Cell/ErrorCodes.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "sys_mutex.h"
|
||||
#include "sys_ppu_thread.h"
|
||||
|
||||
LOG_CHANNEL(sys_ppu_thread);
|
||||
|
|
@ -17,24 +16,25 @@ void _sys_ppu_thread_exit(PPUThread& ppu, u64 errorcode)
|
|||
|
||||
LV2_LOCK;
|
||||
|
||||
// get all sys_mutex objects
|
||||
for (auto& mutex : idm::get_all<lv2_mutex_t>())
|
||||
{
|
||||
// unlock mutex if locked by this thread
|
||||
if (mutex->owner.get() == &ppu)
|
||||
{
|
||||
mutex->unlock(lv2_lock);
|
||||
}
|
||||
}
|
||||
// TODO: Should we really unlock mutexes?
|
||||
|
||||
//// get all sys_mutex objects
|
||||
//for (auto& mutex : idm::get_all<lv2_mutex_t>())
|
||||
//{
|
||||
// // unlock mutex if locked by this thread
|
||||
// if (mutex->owner.get() == &ppu)
|
||||
// {
|
||||
// mutex->unlock(lv2_lock);
|
||||
// }
|
||||
//}
|
||||
|
||||
ppu.state += cpu_state::exit;
|
||||
|
||||
// Delete detached thread
|
||||
if (!ppu.is_joinable)
|
||||
{
|
||||
idm::remove<PPUThread>(ppu.id);
|
||||
}
|
||||
else
|
||||
{
|
||||
ppu.state += cpu_state::exit;
|
||||
}
|
||||
|
||||
// Throw if this syscall was not called directly by the SC instruction (hack)
|
||||
if (ppu.GPR[11] != 41 || ppu.custom_task)
|
||||
|
|
@ -81,7 +81,7 @@ s32 sys_ppu_thread_join(PPUThread& ppu, u32 thread_id, vm::ptr<u64> vptr)
|
|||
{
|
||||
CHECK_EMU_STATUS;
|
||||
|
||||
ppu.cv.wait_for(lv2_lock, std::chrono::milliseconds(1));
|
||||
get_current_thread_cv().wait_for(lv2_lock, std::chrono::milliseconds(1));
|
||||
}
|
||||
|
||||
// get exit status from the register
|
||||
|
|
@ -236,7 +236,7 @@ u32 ppu_thread_create(u32 entry, u64 arg, s32 prio, u32 stacksize, const std::st
|
|||
|
||||
ppu->GPR[3] = arg;
|
||||
ppu->state -= cpu_state::stop;
|
||||
ppu->safe_notify();
|
||||
ppu->lock_notify();
|
||||
|
||||
return ppu->id;
|
||||
}
|
||||
|
|
@ -294,7 +294,7 @@ s32 sys_ppu_thread_start(u32 thread_id)
|
|||
}
|
||||
|
||||
thread->state -= cpu_state::stop;
|
||||
thread->safe_notify();
|
||||
thread->lock_notify();
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue