[client] main: fix race condition on usage of events

This commit is contained in:
Geoffrey McRae 2022-05-24 11:06:47 +10:00
parent d1e421f8a8
commit 6384a8d006

View file

@ -1178,6 +1178,20 @@ static int lg_run(void)
return -1; return -1;
} }
// setup the startup condition
if (!(e_startup = lgCreateEvent(false, 0)))
{
DEBUG_ERROR("failed to create the startup event");
return -1;
}
// setup the new frame event
if (!(g_state.frameEvent = lgCreateEvent(!g_state.jitRender, 0)))
{
DEBUG_ERROR("failed to create the frame event");
return -1;
}
//setup the render command queue //setup the render command queue
renderQueue_init(); renderQueue_init();
@ -1290,20 +1304,6 @@ static int lg_run(void)
keybind_commonRegister(); keybind_commonRegister();
// setup the startup condition
if (!(e_startup = lgCreateEvent(false, 0)))
{
DEBUG_ERROR("failed to create the startup event");
return -1;
}
// setup the new frame event
if (!(g_state.frameEvent = lgCreateEvent(!g_state.jitRender, 0)))
{
DEBUG_ERROR("failed to create the frame event");
return -1;
}
if (g_state.jitRender) if (g_state.jitRender)
DEBUG_INFO("Using JIT render mode"); DEBUG_INFO("Using JIT render mode");