mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-06-04 05:44:47 +00:00
[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:
committed by
Geoffrey McRae
parent
65005c0dc0
commit
dbb80ebd66
@@ -554,6 +554,7 @@ void core_handleMouseNormal(double ex, double ey)
|
|||||||
{
|
{
|
||||||
/* wait for the move request to be processed */
|
/* wait for the move request to be processed */
|
||||||
g_cursor.realigning = true;
|
g_cursor.realigning = true;
|
||||||
|
unsigned timeout = 200;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
LG_LOCK(g_state.pointerQueueLock);
|
LG_LOCK(g_state.pointerQueueLock);
|
||||||
@@ -577,6 +578,14 @@ void core_handleMouseNormal(double ex, double ey)
|
|||||||
if (hostSerial >= setPosSerial)
|
if (hostSerial >= setPosSerial)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (--timeout == 0)
|
||||||
|
{
|
||||||
|
DEBUG_ERROR(
|
||||||
|
"pointerQueue serial not updating, expected %u but stuck at %u",
|
||||||
|
setPosSerial, hostSerial);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
g_state.ds->wait(1);
|
g_state.ds->wait(1);
|
||||||
}
|
}
|
||||||
while(app_isRunning());
|
while(app_isRunning());
|
||||||
|
|||||||
Reference in New Issue
Block a user