fix(GTA Data Service): Dead lock (#971)

This commit is contained in:
Yimura
2023-02-10 22:36:32 +01:00
committed by GitHub
parent b9f380e49c
commit 0d603c849a
3 changed files with 15 additions and 2 deletions

View File

@ -51,10 +51,15 @@ namespace big
void gta_data_service::update_in_online()
{
m_update_state = eGtaDataUpdateState::WAITING_FOR_ONLINE;
m_update_state = eGtaDataUpdateState::WAITING_FOR_SINGLE_PLAYER;
g_fiber_pool->queue_job([this]
{
while (*g_pointers->m_game_state != eGameState::Playing)
{
script::get_current()->yield(100ms);
}
m_update_state = eGtaDataUpdateState::WAITING_FOR_ONLINE;
session::join_type(eSessionType::SOLO);
while (!*g_pointers->m_is_session_started)
@ -68,6 +73,7 @@ namespace big
void gta_data_service::update_now()
{
m_update_state = eGtaDataUpdateState::WAITING_FOR_SINGLE_PLAYER;
g_fiber_pool->queue_job([this]
{
rebuild_cache();

View File

@ -10,6 +10,7 @@ namespace big
{
IDLE,
NEEDS_UPDATE,
WAITING_FOR_SINGLE_PLAYER,
WAITING_FOR_ONLINE,
UPDATING
};