[client]: core: add timeout on pointerQueue wait loop

If the host has had a fault this loop can become infinite,
soft-locking the application. This adds a 200ms timeout to prevent this.
This commit is contained in:
Geoffrey McRae
2026-06-02 21:20:06 +10:00
committed by Geoffrey McRae
parent 65005c0dc0
commit dbb80ebd66

View File

@@ -554,6 +554,7 @@ void core_handleMouseNormal(double ex, double ey)
{
/* wait for the move request to be processed */
g_cursor.realigning = true;
unsigned timeout = 200;
do
{
LG_LOCK(g_state.pointerQueueLock);
@@ -577,6 +578,14 @@ void core_handleMouseNormal(double ex, double ey)
if (hostSerial >= setPosSerial)
break;
if (--timeout == 0)
{
DEBUG_ERROR(
"pointerQueue serial not updating, expected %u but stuck at %u",
setPosSerial, hostSerial);
break;
}
g_state.ds->wait(1);
}
while(app_isRunning());