Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed serviceThreads to fix crash #444

Merged
merged 4 commits into from Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion path_8_6x/config.lua
Expand Up @@ -288,7 +288,6 @@
daemonize = false
defaultPriority = "higher"
niceLevel = 5
serviceThreads = 1
coresUsed = "-1" -- ("0, 1, 2, 3") -- For QuadCore ONLY Windows
startupDatabaseOptimization = true
removePremiumOnInit = true
Expand Down
1 change: 0 additions & 1 deletion path_8_6x/sources/configmanager.cpp
Expand Up @@ -102,7 +102,6 @@ bool ConfigManager::load()
m_confBool[OPTIMIZE_DATABASE] = getGlobalBool("startupDatabaseOptimization", true);
m_confString[MAP_NAME] = getGlobalString("mapName", "forgotten.otbm");
m_confBool[GLOBALSAVE_ENABLED] = getGlobalBool("globalSaveEnabled", true);
m_confNumber[SERVICE_THREADS] = getGlobalNumber("serviceThreads", 1);
m_confNumber[GLOBALSAVE_H] = getGlobalNumber("globalSaveHour", 8);
m_confNumber[GLOBALSAVE_M] = getGlobalNumber("globalSaveMinute", 0);
m_confString[HOUSE_RENT_PERIOD] = getGlobalString("houseRentPeriod", "monthly");
Expand Down
1 change: 0 additions & 1 deletion path_8_6x/sources/configmanager.h
Expand Up @@ -193,7 +193,6 @@ class ConfigManager
ROOK_TOWN,
ROOK_LEVELTO,
ROOK_TOLEVEL,
SERVICE_THREADS,
GUI_PREMIUM_DAYS,
FOLLOW_EXHAUST,
PACKETS_PER_SECOND,
Expand Down
13 changes: 2 additions & 11 deletions path_8_6x/sources/server.cpp
Expand Up @@ -236,19 +236,10 @@ void ServiceManager::run()
assert(!running);
try
{
std::vector<boost::shared_ptr<boost::thread> > threads;
for(uint32_t i = 0; i < g_config.getNumber(ConfigManager::SERVICE_THREADS); ++i)
{
boost::shared_ptr<boost::thread> thread(new boost::thread(
boost::bind(&boost::asio::io_service::run, &m_io_service)));
threads.push_back(thread);
}

m_io_service.run();
running = true;
for(std::vector<boost::shared_ptr<boost::thread> >::const_iterator it = threads.begin(); it != threads.end(); ++it)
(*it)->join();
}
catch(std::exception& e)
catch (std::exception& e)
{
LOG_MESSAGE(LOGTYPE_ERROR, e.what(), "NETWORK")
}
Expand Down