diff --git a/core/libs/tests/GuestRaiseException.cpp b/core/libs/tests/GuestRaiseException.cpp index 4d17541a8..aa715601e 100644 --- a/core/libs/tests/GuestRaiseException.cpp +++ b/core/libs/tests/GuestRaiseException.cpp @@ -73,6 +73,7 @@ static std::mutex hostLock; static constexpr int HostRounds = 20; static std::atomic hostRound{0}; +static std::atomic hostAcquired{0}; static void* APS5_VABI HostBlocked(void* arg) { auto& worker = *static_cast(arg); @@ -81,6 +82,7 @@ static void* APS5_VABI HostBlocked(void* arg) { while (hostRound.load() != round) std::this_thread::yield(); worker.started.store(true); std::lock_guard lock(hostLock); + hostAcquired.store(round + 1); } return nullptr; } @@ -164,6 +166,7 @@ int main() { Require(sceKernelRaiseException(blockedThread, SIGUSR1) == 0); hostLock.unlock(); ExpectDelivery(1 + 2 * Repeats + round, blocked.id); + while (hostAcquired.load() != round + 1) std::this_thread::yield(); hostLock.lock(); blocked.started.store(false); hostRound.store(round + 1);