diff --git a/core/cont/src/TObjArray.cxx b/core/cont/src/TObjArray.cxx
index fc50fa56b7ac5c3271ee1599c92c4fee6bb1df49..626b8c1737696384d6e893082a14d83f9ba50c2e 100644
--- a/core/cont/src/TObjArray.cxx
+++ b/core/cont/src/TObjArray.cxx
@@ -546,9 +546,11 @@ Int_t TObjArray::GetAbsLast() const
    if (fLast == -2) {
       for (Int_t i = fSize-1; i >= 0; i--)
          if (fCont[i]) {
+            R__COLLECTION_WRITE_LOCKGUARD(ROOT::gCoreMutex);
             ((TObjArray*)this)->fLast = i;
             return fLast;
          }
+      R__COLLECTION_WRITE_LOCKGUARD(ROOT::gCoreMutex);
       ((TObjArray*)this)->fLast = -1;
    }
    return fLast;