mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Merge pull request #8763 from JosJuice/panic-alert-deadlock-gpu
DolphinQt: Fix the panic alert deadlock, dual core edition
This commit is contained in:
@ -127,6 +127,7 @@ static std::queue<HostJob> s_host_jobs_queue;
|
||||
static Common::Event s_cpu_thread_job_finished;
|
||||
|
||||
static thread_local bool tls_is_cpu_thread = false;
|
||||
static thread_local bool tls_is_gpu_thread = false;
|
||||
|
||||
static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi);
|
||||
|
||||
@ -203,14 +204,7 @@ bool IsCPUThread()
|
||||
|
||||
bool IsGPUThread()
|
||||
{
|
||||
if (Core::System::GetInstance().IsDualCoreMode())
|
||||
{
|
||||
return (s_emu_thread.joinable() && (s_emu_thread.get_id() == std::this_thread::get_id()));
|
||||
}
|
||||
else
|
||||
{
|
||||
return IsCPUThread();
|
||||
}
|
||||
return tls_is_gpu_thread;
|
||||
}
|
||||
|
||||
bool WantsDeterminism()
|
||||
@ -313,6 +307,16 @@ void UndeclareAsCPUThread()
|
||||
tls_is_cpu_thread = false;
|
||||
}
|
||||
|
||||
void DeclareAsGPUThread()
|
||||
{
|
||||
tls_is_gpu_thread = true;
|
||||
}
|
||||
|
||||
void UndeclareAsGPUThread()
|
||||
{
|
||||
tls_is_gpu_thread = false;
|
||||
}
|
||||
|
||||
// For the CPU Thread only.
|
||||
static void CPUSetInitialExecutionState(bool force_paused = false)
|
||||
{
|
||||
@ -459,6 +463,8 @@ static void EmuThread(std::unique_ptr<BootParameters> boot, WindowSystemInfo wsi
|
||||
|
||||
Common::SetCurrentThreadName("Emuthread - Starting");
|
||||
|
||||
DeclareAsGPUThread();
|
||||
|
||||
// For a time this acts as the CPU thread...
|
||||
DeclareAsCPUThread();
|
||||
s_frame_step = false;
|
||||
|
Reference in New Issue
Block a user