mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Use two threads for the server thread pool
This might help with long DNS timeouts.
This commit is contained in:
parent
fc7b3732e6
commit
a36250ba34
|
@ -3588,7 +3588,7 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
pClient->RegisterInterfaces();
|
||||
|
||||
// create the components
|
||||
IEngine *pEngine = CreateEngine("DDNet", Silent);
|
||||
IEngine *pEngine = CreateEngine("DDNet", Silent, 1);
|
||||
IConsole *pConsole = CreateConsole(CFGFLAG_CLIENT);
|
||||
IStorage *pStorage = CreateStorage("Teeworlds", IStorage::STORAGETYPE_CLIENT, argc, argv); // ignore_convention
|
||||
IConfig *pConfig = CreateConfig();
|
||||
|
|
|
@ -34,6 +34,6 @@ public:
|
|||
virtual void AddJob(std::shared_ptr<IJob> pJob) = 0;
|
||||
};
|
||||
|
||||
extern IEngine *CreateEngine(const char *pAppname, bool Silent);
|
||||
extern IEngine *CreateEngine(const char *pAppname, bool Silent, int Jobs);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2859,7 +2859,7 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
IKernel *pKernel = IKernel::Create();
|
||||
|
||||
// create the components
|
||||
IEngine *pEngine = CreateEngine("DDNet", Silent);
|
||||
IEngine *pEngine = CreateEngine("DDNet", Silent, 2);
|
||||
IEngineMap *pEngineMap = CreateEngineMap();
|
||||
IGameServer *pGameServer = CreateGameServer();
|
||||
IConsole *pConsole = CreateConsole(CFGFLAG_SERVER|CFGFLAG_ECON);
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
CEngine(const char *pAppname, bool Silent)
|
||||
CEngine(const char *pAppname, bool Silent, int Jobs)
|
||||
{
|
||||
if(!Silent)
|
||||
dbg_logger_stdout();
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
net_init();
|
||||
CNetBase::Init();
|
||||
|
||||
m_JobPool.Init(1);
|
||||
m_JobPool.Init(Jobs);
|
||||
|
||||
m_Logging = false;
|
||||
}
|
||||
|
@ -105,4 +105,4 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
IEngine *CreateEngine(const char *pAppname, bool Silent) { return new CEngine(pAppname, Silent); }
|
||||
IEngine *CreateEngine(const char *pAppname, bool Silent, int Jobs) { return new CEngine(pAppname, Silent, Jobs); }
|
||||
|
|
Loading…
Reference in a new issue