Browse Source

consistent and independent thread naming

Mircea TheHonestCTO 3 tháng trước cách đây
mục cha
commit
810e3570b3
2 tập tin đã thay đổi với 4 bổ sung6 xóa
  1. 2 3
      AI/Nullkiller/AIGateway.cpp
  2. 2 3
      AI/Nullkiller2/AIGateway.cpp

+ 2 - 3
AI/Nullkiller/AIGateway.cpp

@@ -603,7 +603,7 @@ void AIGateway::yourTurn(QueryID queryID)
 
 	asyncTasks->run([this]()
 	{
-		ScopedThreadName guard("NKAI::makingTurn");
+		ScopedThreadName guard("NKAI::AIGateway::makingTurn");
 		makeTurn();
 	});
 }
@@ -845,7 +845,6 @@ bool AIGateway::makePossibleUpgrades(const CArmedInstance * obj)
 
 void AIGateway::makeTurn()
 {
-	setThreadName("AIGateway::makeTurn");
 	MAKING_TURN;
 
 	auto day = cb->getDate(Date::DAY);
@@ -1628,7 +1627,7 @@ void AIGateway::executeActionAsync(const std::string & description, const std::f
 
 	asyncTasks->run([this, description, whatToDo]()
 	{
-		ScopedThreadName guard("NKAI::" + description);
+		ScopedThreadName guard("NKAI::AIGateway::" + description);
 		SET_GLOBAL_STATE(this);
 		std::shared_lock gsLock(CGameState::mutex);
 		whatToDo();

+ 2 - 3
AI/Nullkiller2/AIGateway.cpp

@@ -603,7 +603,7 @@ void AIGateway::yourTurn(QueryID queryID)
 
 	asyncTasks->run([this]()
 	{
-		ScopedThreadName guard("NKAI::makingTurn");
+		ScopedThreadName guard("NK2AI::AIGateway::makingTurn");
 		makeTurn();
 	});
 }
@@ -845,7 +845,6 @@ bool AIGateway::makePossibleUpgrades(const CArmedInstance * obj)
 
 void AIGateway::makeTurn()
 {
-	setThreadName("AIGateway2::makeTurn");
 	MAKING_TURN;
 
 	auto day = cb->getDate(Date::DAY);
@@ -1628,7 +1627,7 @@ void AIGateway::executeActionAsync(const std::string & description, const std::f
 
 	asyncTasks->run([this, description, whatToDo]()
 	{
-		ScopedThreadName guard("NKAI::" + description);
+		ScopedThreadName guard("NK2AI::AIGateway::" + description);
 		SET_GLOBAL_STATE(this);
 		std::shared_lock gsLock(CGameState::mutex);
 		whatToDo();