Skip to content

Commit

Permalink
LV2: Fixup reservation notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Aug 17, 2023
1 parent 19bfce4 commit 61933cd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rpcs3/Emu/Cell/lv2/sys_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "Emu/Cell/timers.hpp"
#include "Emu/IdManager.h"
#include "Emu/IPC.h"
#include "Emu/Memory/vm.h"

#include <thread>

Expand Down Expand Up @@ -432,9 +433,15 @@ struct lv2_obj

if (cpu != &g_to_notify)
{
// Note: by the time of notification the thread could have been deallocated which is why the direct function is used
// TODO: Pass a narrower mask
atomic_wait_engine::notify_one(cpu);
if (cpu >= vm::g_reservations && cpu <= vm::g_reservations + (std::size(vm::g_reservations) - 1))
{
atomic_wait_engine::notify_all(cpu);
}
else
{
// Note: by the time of notification the thread could have been deallocated which is why the direct function is used
atomic_wait_engine::notify_one(cpu);
}
}
}

Expand Down

0 comments on commit 61933cd

Please sign in to comment.