mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-21 19:40:39 +00:00
Tweak terminate() slightly
* Gave it a default argument, since we never actually care about it, but it needs to have it to conform to the signal handler prototype * Constricted the area locked by activeCrit to only the block that deals with the connections vector, to lower the chance of a future badly placed call to terminate() deadlocking the server instead
This commit is contained in:
@@ -42,7 +42,7 @@ void startShard(CNShardServer* server) {
|
||||
server->start();
|
||||
}
|
||||
|
||||
// terminate gracefully on SIGINT (for gprof)
|
||||
// terminate gracefully on SIGINT (for gprof & DB saving)
|
||||
void terminate(int arg) {
|
||||
std::cout << "OpenFusion: terminating." << std::endl;
|
||||
|
||||
@@ -111,7 +111,7 @@ int main() {
|
||||
case 3: std::cout << "[INFO] Event active. Have a very hoppy Easter!" << std::endl; break;
|
||||
default:
|
||||
std::cout << "[FATAL] Unknown event set in config file." << std::endl;
|
||||
terminate(0);
|
||||
terminate();
|
||||
/* not reached */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user