From 998e13365a4cf976200895680305b1c6bf40dddc Mon Sep 17 00:00:00 2001
From: Philippe Canal <pcanal@fnal.gov>
Date: Sat, 25 Nov 2017 13:12:26 -0600
Subject: [PATCH] Add check that TDirectory::fList is using the RW lock

---
 core/base/src/TDirectory.cxx | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/core/base/src/TDirectory.cxx b/core/base/src/TDirectory.cxx
index 1756bf389c0..0bee532634a 100644
--- a/core/base/src/TDirectory.cxx
+++ b/core/base/src/TDirectory.cxx
@@ -108,6 +108,9 @@ TDirectory::~TDirectory()
    }
 
    if (fList) {
+      if (!fList->IsUsingRWLock())
+         Fatal("~TDirectory","In %s:%p the fList (%p) is not using the RWLock\n",
+               GetName(),this,fList);
       fList->Delete("slow");
       SafeDelete(fList);
    }
-- 
GitLab