fix(GTA Data Service): Dead lock (#971)
This commit is contained in:
parent
da0d98ef0e
commit
37199eaefa
@ -51,10 +51,15 @@ namespace big
|
|||||||
|
|
||||||
void gta_data_service::update_in_online()
|
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]
|
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);
|
session::join_type(eSessionType::SOLO);
|
||||||
|
|
||||||
while (!*g_pointers->m_is_session_started)
|
while (!*g_pointers->m_is_session_started)
|
||||||
@ -68,6 +73,7 @@ namespace big
|
|||||||
|
|
||||||
void gta_data_service::update_now()
|
void gta_data_service::update_now()
|
||||||
{
|
{
|
||||||
|
m_update_state = eGtaDataUpdateState::WAITING_FOR_SINGLE_PLAYER;
|
||||||
g_fiber_pool->queue_job([this]
|
g_fiber_pool->queue_job([this]
|
||||||
{
|
{
|
||||||
rebuild_cache();
|
rebuild_cache();
|
||||||
|
@ -10,6 +10,7 @@ namespace big
|
|||||||
{
|
{
|
||||||
IDLE,
|
IDLE,
|
||||||
NEEDS_UPDATE,
|
NEEDS_UPDATE,
|
||||||
|
WAITING_FOR_SINGLE_PLAYER,
|
||||||
WAITING_FOR_ONLINE,
|
WAITING_FOR_ONLINE,
|
||||||
UPDATING
|
UPDATING
|
||||||
};
|
};
|
||||||
|
@ -50,6 +50,12 @@ namespace big
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case eGtaDataUpdateState::WAITING_FOR_SINGLE_PLAYER:
|
||||||
|
{
|
||||||
|
ImGui::Text("GAME_CACHE_WAITING_FOR_SINGLE_PLAYER"_T.data());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case eGtaDataUpdateState::WAITING_FOR_ONLINE:
|
case eGtaDataUpdateState::WAITING_FOR_ONLINE:
|
||||||
{
|
{
|
||||||
ImGui::Text("GAME_CACHE_WAITING_FOR_ONLINE"_T.data());
|
ImGui::Text("GAME_CACHE_WAITING_FOR_ONLINE"_T.data());
|
||||||
|
Reference in New Issue
Block a user