feat(Backend): Run login in thread pool

This commit is contained in:
Yimura 2021-09-18 22:10:38 +02:00
parent ce5ccbf48f
commit 0106d8a02e
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682

View File

@ -1,8 +1,10 @@
#include "api/api.hpp"
#include "backend.hpp" #include "backend.hpp"
#include "fiber_pool.hpp" #include "fiber_pool.hpp"
#include "looped/looped.hpp" #include "looped/looped.hpp"
#include "pointers.hpp" #include "pointers.hpp"
#include "script.hpp" #include "script.hpp"
#include "thread_pool.hpp"
namespace big namespace big
{ {
@ -17,10 +19,13 @@ namespace big
looped::system_update_pointers(); looped::system_update_pointers();
}QUEUE_JOB_END_CLAUSE }QUEUE_JOB_END_CLAUSE
g_fiber_pool->queue_job([] if (g_local_player != nullptr && !api::util::signed_in())
{ {
looped::api_login_session(); g_thread_pool->push([]
}); {
looped::api_login_session();
});
}
QUEUE_JOB_BEGIN_CLAUSE() QUEUE_JOB_BEGIN_CLAUSE()
{ {