Browse Source

task: Fix first frame on task chain missed by PStats

rdb 10 months ago
parent
commit
674fa4480b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      panda/src/event/asyncTaskChain.cxx

+ 3 - 0
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();