mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] fix crash on shutdown while waiting for a restart
This commit is contained in:
parent
da8b2d0cec
commit
fa50b7824c
@ -289,8 +289,9 @@ static int cursorThread(void * unused)
|
|||||||
|
|
||||||
if (status == LGMP_ERR_INVALID_SESSION)
|
if (status == LGMP_ERR_INVALID_SESSION)
|
||||||
state.restart = true;
|
state.restart = true;
|
||||||
|
else
|
||||||
|
DEBUG_ERROR("lgmpClientProcess Failed: %s", lgmpStatusString(status));
|
||||||
|
|
||||||
DEBUG_ERROR("lgmpClientProcess Failed: %s", lgmpStatusString(status));
|
|
||||||
state.running = false;
|
state.running = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -400,8 +401,9 @@ static int frameThread(void * unused)
|
|||||||
|
|
||||||
if (status == LGMP_ERR_INVALID_SESSION)
|
if (status == LGMP_ERR_INVALID_SESSION)
|
||||||
state.restart = true;
|
state.restart = true;
|
||||||
|
else
|
||||||
|
DEBUG_ERROR("lgmpClientProcess Failed: %s", lgmpStatusString(status));
|
||||||
|
|
||||||
DEBUG_ERROR("lgmpClientProcess Failed: %s", lgmpStatusString(status));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1448,8 +1450,6 @@ static int lg_run()
|
|||||||
|
|
||||||
LGMP_STATUS status;
|
LGMP_STATUS status;
|
||||||
|
|
||||||
restart:
|
|
||||||
|
|
||||||
while(state.running)
|
while(state.running)
|
||||||
{
|
{
|
||||||
if ((status = lgmpClientInit(state.shm.mem, state.shm.size, &state.lgmp)) == LGMP_OK)
|
if ((status = lgmpClientInit(state.shm.mem, state.shm.size, &state.lgmp)) == LGMP_OK)
|
||||||
@ -1465,9 +1465,9 @@ restart:
|
|||||||
|
|
||||||
uint32_t udataSize;
|
uint32_t udataSize;
|
||||||
KVMFR *udata;
|
KVMFR *udata;
|
||||||
int waitCount;
|
int waitCount = 0;
|
||||||
|
|
||||||
waitCount = 0;
|
restart:
|
||||||
while(state.running)
|
while(state.running)
|
||||||
{
|
{
|
||||||
if ((status = lgmpClientSessionInit(state.lgmp, &udataSize, (uint8_t **)&udata)) == LGMP_OK)
|
if ((status = lgmpClientSessionInit(state.lgmp, &udataSize, (uint8_t **)&udata)) == LGMP_OK)
|
||||||
@ -1550,16 +1550,19 @@ restart:
|
|||||||
if (state.restart)
|
if (state.restart)
|
||||||
{
|
{
|
||||||
state.running = false;
|
state.running = false;
|
||||||
|
|
||||||
lgSignalEvent(e_startup);
|
lgSignalEvent(e_startup);
|
||||||
lgSignalEvent(e_frame);
|
lgSignalEvent(e_frame);
|
||||||
lgJoinThread(t_frame , NULL);
|
lgJoinThread(t_frame , NULL);
|
||||||
lgJoinThread(t_cursor, NULL);
|
lgJoinThread(t_cursor, NULL);
|
||||||
|
t_frame = NULL;
|
||||||
|
t_cursor = NULL;
|
||||||
|
|
||||||
state.running = true;
|
state.running = true;
|
||||||
state.restart = false;
|
state.restart = false;
|
||||||
|
|
||||||
state.lgr->on_restart(state.lgrData);
|
state.lgr->on_restart(state.lgrData);
|
||||||
|
|
||||||
lgmpClientFree(&state.lgmp);
|
|
||||||
DEBUG_INFO("Waiting for the host to restart...");
|
DEBUG_INFO("Waiting for the host to restart...");
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user