From d3527f383099ac35badc76c181d4546ccece5b11 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 16 Jun 2010 08:13:00 +0000 Subject: [PATCH] Added timing code for helping detect deadlocks in the paging threads --- include/osgDB/DatabasePager | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/osgDB/DatabasePager b/include/osgDB/DatabasePager index 1b2b23465..7b5e9fc57 100644 --- a/include/osgDB/DatabasePager +++ b/include/osgDB/DatabasePager @@ -97,13 +97,18 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl DatabaseThread(DatabasePager* pager, Mode mode, const std::string& name); DatabaseThread(const DatabaseThread& dt, DatabasePager* pager); - + + void setName(const std::string& name) { _name = name; } + const std::string& getName() const { return _name; } + void setDone(bool done) { _done = done; } bool getDone() const { return _done; } void setActive(bool active) { _active = active; } bool getActive() const { return _active; } + double getTimeSinceStartOfIteration() const; + virtual int cancel(); virtual void run(); @@ -117,6 +122,8 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl DatabasePager* _pager; Mode _mode; std::string _name; + osg::Timer_t _tickSinceStartOfIteration; + }; void setUpThreads(unsigned int totalNumThreads=2, unsigned int numHttpThreads=1);