From 674fa4480b8360eb8b8f8ed3124e25300e5506a8 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jan 2025 22:14:01 +0100 Subject: [PATCH] task: Fix first frame on task chain missed by PStats --- panda/src/event/asyncTaskChain.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/event/asyncTaskChain.cxx b/panda/src/event/asyncTaskChain.cxx index a854596898..9ab2093fa3 100644 --- a/panda/src/event/asyncTaskChain.cxx +++ b/panda/src/event/asyncTaskChain.cxx @@ -1438,6 +1438,9 @@ AsyncTaskChainThread(const string &name, AsyncTaskChain *chain) : void AsyncTaskChain::AsyncTaskChainThread:: thread_main() { #ifdef HAVE_THREADS + // Let PStats know this thread exists. + PStatClient::thread_tick(); + MutexHolder holder(_chain->_manager->_lock); while (_chain->_state != S_shutdown && _chain->_state != S_interrupted) { thread_consider_yield();