From 1610e95cbc4b05e747df5fcd42dffc3b98dfff60 Mon Sep 17 00:00:00 2001 From: cantor Date: Sun, 27 Jan 2008 20:27:47 +0000 Subject: [PATCH] Add some logging. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@457 de75baf8-a10c-0410-a50a-987c0e22f00f --- xmltooling/util/ReloadableXMLFile.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmltooling/util/ReloadableXMLFile.cpp b/xmltooling/util/ReloadableXMLFile.cpp index fe7a54b..27c6ae5 100644 --- a/xmltooling/util/ReloadableXMLFile.cpp +++ b/xmltooling/util/ReloadableXMLFile.cpp @@ -225,10 +225,12 @@ Lockable* ReloadableXMLFile::lock() return this; // Elevate lock and recheck. + m_log.debug("timestamp of local resource changed, elevating to a write lock"); m_lock->unlock(); m_lock->wrlock(); if (m_filestamp>=stat_buf.st_mtime) { // Somebody else handled it, just downgrade. + m_log.debug("update of local resource handled by another thread, downgrading lock"); m_lock->unlock(); m_lock->rdlock(); return this; @@ -247,10 +249,12 @@ Lockable* ReloadableXMLFile::lock() return this; // Elevate lock and recheck. + m_log.debug("reload interval for remote resource elapsed, elevating to a write lock"); m_lock->unlock(); m_lock->wrlock(); if (now - m_filestamp < m_reloadInterval) { // Somebody else handled it, just downgrade. + m_log.debug("update of remote resource handled by another thread, downgrading lock"); m_lock->unlock(); m_lock->rdlock(); return this; @@ -272,6 +276,7 @@ Lockable* ReloadableXMLFile::lock() } // If we made it here, the swap may or may not have worked, but we need to relock. + m_log.debug("attempt to update resource complete, relocking"); m_lock->rdlock(); return this; } -- 2.1.4