diag(threading): Add debug logging to RegisterTaskStart

Added periodic logging (every 100 registrations) to verify that
RegisterTaskStart is actually being called. This helps diagnose why
"0 tasks tracked" is showing despite tasks being in-flight.

Also improved LogStuckTasks to always output a summary showing
total tracked and stuck count for better diagnostics.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: luis <[email protected]>
This commit is contained in:
agatho
2026-02-02 13:35:32 -03:00
committed by luis
co-authored by Claude Opus 4.5
parent cd2f95ff2a
commit 3013dfd1cf
@@ -50,6 +50,15 @@ namespace {
{
::std::lock_guard lock(_executingTasksMutex);
_executingTasks[guid] = { guid, ::std::chrono::steady_clock::now(), botName };
// DEBUG: Log registration to verify code is being called
static uint32 regCount = 0;
if (++regCount % 100 == 1) // Log every 100th registration to avoid spam
{
TC_LOG_INFO("module.playerbot.session",
"RegisterTaskStart: Bot {} (GUID: {}), total tracked: {}",
botName, guid.ToString(), _executingTasks.size());
}
}
void RegisterTaskEnd(ObjectGuid guid)