better pstats tracking of loader task
This commit is contained in:
parent
ee3d5337d5
commit
601057c3a0
|
|
@ -1,4 +1,4 @@
|
|||
#define LOCAL_LIBS putil express pandabase
|
||||
#define LOCAL_LIBS putil express pandabase pstatclient
|
||||
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
|
||||
dtoolutil:c dtoolbase:c dtool:m prc:c
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,14 @@
|
|||
#include "eventParameter.h"
|
||||
#include "mutexHolder.h"
|
||||
#include "indent.h"
|
||||
#include "pStatClient.h"
|
||||
#include "pStatTimer.h"
|
||||
|
||||
TypeHandle AsyncTaskManager::_type_handle;
|
||||
|
||||
PStatCollector AsyncTaskManager::_task_pcollector("Task");
|
||||
PStatCollector AsyncTaskManager::_wait_pcollector("Wait");
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AsyncTaskManager::Constructor
|
||||
// Access: Published
|
||||
|
|
@ -406,9 +411,17 @@ void AsyncTaskManager::AsyncTaskManagerThread::
|
|||
thread_main() {
|
||||
MutexHolder holder(_manager->_lock);
|
||||
while (_manager->_state != AsyncTaskManager::S_shutdown) {
|
||||
_manager->service_one_task(this);
|
||||
PStatClient::thread_tick(_manager->get_name());
|
||||
|
||||
{
|
||||
PStatTimer timer(_task_pcollector);
|
||||
_manager->service_one_task(this);
|
||||
}
|
||||
|
||||
if (_manager->_active.empty() &&
|
||||
_manager->_state != AsyncTaskManager::S_shutdown) {
|
||||
PStatClient::thread_tick(_manager->get_name());
|
||||
PStatTimer timer(_wait_pcollector);
|
||||
_manager->_cvar.wait();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "conditionVarFull.h"
|
||||
#include "pvector.h"
|
||||
#include "pdeque.h"
|
||||
#include "pStatCollector.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : AsyncTaskManager
|
||||
|
|
@ -100,6 +101,9 @@ protected:
|
|||
int _num_tasks;
|
||||
State _state;
|
||||
|
||||
static PStatCollector _task_pcollector;
|
||||
static PStatCollector _wait_pcollector;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
|
|
|
|||
Loading…
Reference in New Issue