From ddc122bcbecc874e22c941bf73c9db5dc67dfcea Mon Sep 17 00:00:00 2001 From: ANR2ME Date: Fri, 5 Feb 2021 21:46:16 +0700 Subject: [PATCH] Moving hleDelayResult from internal function of SetSocketAlert to prevent waking up HLE-blocked thread --- Core/HLE/sceNetAdhoc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index 8270a9140a..001cefe5c6 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -1808,14 +1808,16 @@ int NetAdhoc_SetSocketAlert(int id, s32_le flag) { adhocSockets[id - 1]->flags = flg; adhocSockets[id - 1]->alerted_flags = 0; - return hleDelayResult(0, "set socket alert delay", 1000); + return 0; } // Flags seems to be bitmasks of ADHOC_F_ALERT... (need more games to test this) int sceNetAdhocSetSocketAlert(int id, int flag) { WARN_LOG_REPORT_ONCE(sceNetAdhocSetSocketAlert, SCENET, "UNTESTED sceNetAdhocSetSocketAlert(%d, %08x) at %08x", id, flag, currentMIPS->pc); - return hleLogDebug(SCENET, NetAdhoc_SetSocketAlert(id, flag), ""); + int retval = NetAdhoc_SetSocketAlert(id, flag); + hleDelayResult(retval, "set socket alert delay", 1000); + return hleLogDebug(SCENET, retval, ""); } int PollAdhocSocket(SceNetAdhocPollSd* sds, int count, int timeout, int nonblock) {