Add some logging.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Sun, 27 Jan 2008 20:27:47 +0000 (20:27 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Sun, 27 Jan 2008 20:27:47 +0000 (20:27 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@457 de75baf8-a10c-0410-a50a-987c0e22f00f

xmltooling/util/ReloadableXMLFile.cpp

index fe7a54b..27c6ae5 100644 (file)
@@ -225,10 +225,12 @@ Lockable* ReloadableXMLFile::lock()
             return this;\r
         \r
         // Elevate lock and recheck.\r
+        m_log.debug("timestamp of local resource changed, elevating to a write lock");\r
         m_lock->unlock();\r
         m_lock->wrlock();\r
         if (m_filestamp>=stat_buf.st_mtime) {\r
             // Somebody else handled it, just downgrade.\r
+            m_log.debug("update of local resource handled by another thread, downgrading lock");\r
             m_lock->unlock();\r
             m_lock->rdlock();\r
             return this;\r
@@ -247,10 +249,12 @@ Lockable* ReloadableXMLFile::lock()
             return this;\r
 \r
         // Elevate lock and recheck.\r
+        m_log.debug("reload interval for remote resource elapsed, elevating to a write lock");\r
         m_lock->unlock();\r
         m_lock->wrlock();\r
         if (now - m_filestamp < m_reloadInterval) {\r
             // Somebody else handled it, just downgrade.\r
+            m_log.debug("update of remote resource handled by another thread, downgrading lock");\r
             m_lock->unlock();\r
             m_lock->rdlock();\r
             return this;\r
@@ -272,6 +276,7 @@ Lockable* ReloadableXMLFile::lock()
     }\r
     \r
     // If we made it here, the swap may or may not have worked, but we need to relock.\r
+    m_log.debug("attempt to update resource complete, relocking");\r
     m_lock->rdlock();\r
     return this;\r
 }\r