Skip to content

Commit 393bc9a

Browse files
committed
Reschedule in cellMsgDialogOpen2
1 parent c994b80 commit 393bc9a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
#include "stdafx.h"
1+
#include "stdafx.h"
22
#include "Emu/System.h"
33
#include "Emu/IdManager.h"
44
#include "Emu/Cell/PPUModule.h"
5+
#include "Emu/Cell/PPUThread.h"
6+
#include "Emu/Cell/lv2/sys_sync.h"
57
#include "Emu/RSX/Overlays/overlays.h"
68

79
#include "cellSysutil.h"
@@ -219,18 +221,24 @@ error_code cellMsgDialogOpen2(u32 type, vm::cptr<char> msgString, vm::ptr<CellMs
219221

220222
pad::SetIntercepted(true);
221223

222-
atomic_t<bool> result(false);
224+
auto& ppu = *get_current_cpu_thread();
225+
lv2_obj::sleep(ppu);
223226

224227
// Run asynchronously in GUI thread
225228
Emu.CallAfter([&]()
226229
{
227230
dlg->Create(msgString.get_ptr());
228-
result = true;
231+
lv2_obj::awake(ppu);
229232
});
230233

231-
while (!result)
234+
while (!ppu.state.test_and_reset(cpu_flag::signal))
232235
{
233-
thread_ctrl::wait_for(1000);
236+
if (ppu.is_stopped())
237+
{
238+
return 0;
239+
}
240+
241+
thread_ctrl::wait();
234242
}
235243

236244
return CELL_OK;

0 commit comments

Comments
 (0)